Browse Source

rename localWebServer.create to listen

master
Lloyd Brookes 8 years ago
parent
commit
6757521946
  1. 6
      lib/local-web-server.js
  2. 6
      package.json
  3. 2
      test/test.js

6
lib/local-web-server.js

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

6
package.json

@ -32,9 +32,9 @@
"repository": "https://github.com/lwsjs/local-web-server",
"author": "Lloyd Brookes <75pound@gmail.com>",
"dependencies": {
"lws": "^1.0.0-pre3.1",
"lws": "^1.0.0-pre4.0",
"lws-blacklist": "^0.2.1",
"lws-body-parser": "^0.2.2",
"lws-body-parser": "^0.2.4",
"lws-compress": "^0.2.1",
"lws-conditional-get": "^0.3.3",
"lws-cors": "^0.3.2",
@ -46,7 +46,7 @@
"lws-request-monitor": "^0.1.3",
"lws-rewrite": "^0.3.5",
"lws-spa": "^0.2.2",
"lws-static": "^0.4.0"
"lws-static": "^0.4.1"
},
"devDependencies": {
"coveralls": "^2.13.1",

2
test/test.js

@ -11,7 +11,7 @@ const runner = new TestRunner()
runner.test('basic', async function () {
const port = 9000 + this.index
const localWebServer = new LocalWebServer()
const server = localWebServer.create({
const server = localWebServer.listen({
port: port,
directory: 'test/fixture'
})

Loading…
Cancel
Save