|
@ -59,6 +59,8 @@ function localWebServer (options) { |
|
|
log.format = 'none' |
|
|
log.format = 'none' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!options.static.root) options.static.root = process.cwd() |
|
|
|
|
|
if (!options.serveIndex.path) options.serveIndex.path = process.cwd() |
|
|
options.rewrite = arrayify(options.rewrite) |
|
|
options.rewrite = arrayify(options.rewrite) |
|
|
options.forbid = arrayify(options.forbid) |
|
|
options.forbid = arrayify(options.forbid) |
|
|
options.mocks = arrayify(options.mocks) |
|
|
options.mocks = arrayify(options.mocks) |
|
@ -148,7 +150,7 @@ function localWebServer (options) { |
|
|
/* Mock Responses */ |
|
|
/* Mock Responses */ |
|
|
options.mocks.forEach(mock => { |
|
|
options.mocks.forEach(mock => { |
|
|
if (mock.module) { |
|
|
if (mock.module) { |
|
|
mock.responses = require(path.join(options.static.root, mock.module)) |
|
|
|
|
|
|
|
|
mock.responses = require(path.resolve(path.join(options.static.root, mock.module))) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (mock.responses) { |
|
|
if (mock.responses) { |
|
|