express-mock-api-middleware
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,3 +8,9 @@ { | ||
}, | ||
"rules": {} | ||
"rules": { | ||
"func-names": "off", | ||
"no-else-return": "off", | ||
"no-param-reassign": "off", | ||
"no-restricted-syntax": "off", | ||
"no-use-before-define": "off" | ||
} | ||
} |
@@ -35,3 +35,3 @@ "use strict"; | ||
function getMockMiddleware(mockDir) { | ||
function getMockMiddleware(mockDir, options) { | ||
var absMockPath = mockDir; | ||
@@ -67,5 +67,5 @@ var _console = console, | ||
var mockFiles = _glob.default.sync('**/*.js', { | ||
var mockFiles = _glob.default.sync('**/*.js', _objectSpread({ | ||
cwd: absMockPath | ||
}).map(function (p) { | ||
}, options)).map(function (p) { | ||
return (0, _path.join)(absMockPath, p); | ||
@@ -72,0 +72,0 @@ }); |
@@ -7,4 +7,4 @@ "use strict"; | ||
module.exports = function (mockDir) { | ||
return (0, _createMockMiddleware.default)(mockDir); | ||
module.exports = function (mockDir, options) { | ||
return (0, _createMockMiddleware.default)(mockDir, options); | ||
}; |
{ | ||
"name": "express-mock-api-middleware", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Express middleware for mocking restful APIs", | ||
@@ -37,6 +37,6 @@ "main": "lib/index.js", | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.3.4", | ||
"@babel/preset-env": "^7.3.4", | ||
"@babel/core": "^7.4.0", | ||
"@babel/preset-env": "^7.4.1", | ||
"babel-eslint": "^10.0.1", | ||
"eslint": "^5.15.0", | ||
"eslint": "^5.15.3", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
@@ -43,0 +43,0 @@ "eslint-config-prettier": "^4.1.0", |
@@ -19,3 +19,4 @@ # express-mock-api-middleware | ||
const mockApiMiddleware = require('express-mock-api-middleware')( | ||
path.resolve(__dirname, 'mock') | ||
path.resolve(__dirname, 'mock'), | ||
{ ignore: ['asm.js'] } | ||
); | ||
@@ -25,2 +26,3 @@ app.use(mockApiMiddleware); | ||
`path.resolve(__dirname, 'mock')` is the folder where mock API files are. | ||
`{ ignore: ['asm.js'] }` is the options for more flexible glob. (See [options](https://github.com/isaacs/node-glob#options)) | ||
@@ -27,0 +29,0 @@ ## Mock files |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11338
227
52