|
@ -6,7 +6,7 @@ const path = require('path') |
|
|
* @example |
|
|
* @example |
|
|
* const LocalWebServer = require('local-web-server') |
|
|
* const LocalWebServer = require('local-web-server') |
|
|
* const localWebServer = new LocalWebServer() |
|
|
* const localWebServer = new LocalWebServer() |
|
|
* const server = localWebServer.create({ |
|
|
|
|
|
|
|
|
* const server = localWebServer.listen({ |
|
|
* port: port, |
|
|
* port: port, |
|
|
* directory: 'src' |
|
|
* directory: 'src' |
|
|
* }) |
|
|
* }) |
|
@ -36,7 +36,7 @@ class LocalWebServer extends Lws { |
|
|
* @param [options.moduleDir] {string[]} - One or more directories to search for feature modules. |
|
|
* @param [options.moduleDir] {string[]} - One or more directories to search for feature modules. |
|
|
* @returns {Server} |
|
|
* @returns {Server} |
|
|
*/ |
|
|
*/ |
|
|
create (options) { |
|
|
|
|
|
|
|
|
listen (options) { |
|
|
const usage = require('lws/lib/usage') |
|
|
const usage = require('lws/lib/usage') |
|
|
usage.defaults |
|
|
usage.defaults |
|
|
.set('an', 'ws') |
|
|
.set('an', 'ws') |
|
@ -47,7 +47,7 @@ class LocalWebServer extends Lws { |
|
|
modulePrefix: 'lws-', |
|
|
modulePrefix: 'lws-', |
|
|
stack: require('./default-stack') |
|
|
stack: require('./default-stack') |
|
|
}, options) |
|
|
}, options) |
|
|
return super.create(options) |
|
|
|
|
|
|
|
|
return super.listen(options) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|