diff --git a/lib/local-web-server.js b/lib/local-web-server.js index 7972c1f..9db986b 100644 --- a/lib/local-web-server.js +++ b/lib/local-web-server.js @@ -59,6 +59,8 @@ function localWebServer (options) { 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.forbid = arrayify(options.forbid) options.mocks = arrayify(options.mocks) @@ -148,7 +150,7 @@ function localWebServer (options) { /* Mock Responses */ options.mocks.forEach(mock => { 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) {