Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Advanced API mocker
## Advanced API mocker Version 2

This is a connect.js middleware to mock http request with manual body, headers and status code. Used to mock REST API.

Expand All @@ -20,6 +20,25 @@ middleware: function (connect, opt) {
});
```

If don't want use gulp, you can use without
```javascript
var connect = require('connect');
var http = require('http');
var mocker = require('connect-api-mocker-adv')

var app = connect();

var options = {
urlRoot: '/api',
pathRoot: 'mocks',
ignoreQuery: false
};

app.use(mocker(options));

http.createServer(app).listen(3000);
```

Firstly mocks will be served, than other middleware.

## Structure
Expand Down Expand Up @@ -130,6 +149,16 @@ Default: 0 (unlimited)

Limit speed of response in KB

### options.ignoreQuery

Type: `Boolean`

Default: true

If true querystring is ignored.
- If false - each mock folder will be checked for custom query string.
- Format of subfolders with query: #[parameterName[=parameterValue]]




Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "connect-api-mocker-adv",
"name": "connect-api-mocker-adv-v2",
"version": "0.2.1",
"description": "Middleware to mock connect request",
"main": "index.js",
Expand All @@ -16,9 +16,9 @@
},
"repository": {
"type": "git",
"url": "git://github.com/maxaon/connect-api-mocker-adv.git"
"url": "git://github.com/sgulci/connect-api-mocker-adv.git"
},
"homepage": "https://github.com/maxaon/connect-api-mocker-adv",
"homepage": "https://github.com/sgulci/connect-api-mocker-adv",
"dependencies": {
"js-yaml": "^3.2.6",
"lodash": "^3.2.0"
Expand Down