Browse Source

more middleware added

master
Lloyd Brookes 8 years ago
parent
commit
04e6177d5f
  1. 6
      lib/local-web-server.js
  2. 11
      package.json

6
lib/local-web-server.js

@ -10,9 +10,11 @@ const Lws = require('lws')
*/
class LocalWebServer extends Lws {
constructor () {
super({
stack: [ 'log', 'static' ]
const path = require('path')
const stack = [ 'log', 'cors', 'json', 'rewrite', 'body-parser', 'blacklist', 'conditional-get', 'mime', 'compress', 'static', 'index' ].map(name => {
return path.resolve(__dirname, `../node_modules/local-web-server-${name}`)
})
super({ stack })
}
}

11
package.json

@ -37,9 +37,18 @@
"repository": "https://github.com/75lb/local-web-server",
"author": "Lloyd Brookes <75pound@gmail.com>",
"dependencies": {
"local-web-server-blacklist": "file:///Users/lloydb/Documents/lws/blacklist",
"local-web-server-body-parser": "file:///Users/lloydb/Documents/lws/body-parser",
"local-web-server-compress": "file:///Users/lloydb/Documents/lws/compress",
"local-web-server-conditional-get": "file:///Users/lloydb/Documents/lws/conditional-get",
"local-web-server-cors": "file:///Users/lloydb/Documents/lws/cors",
"local-web-server-index": "file:///Users/lloydb/Documents/lws/index",
"local-web-server-json": "file:///Users/lloydb/Documents/lws/json",
"local-web-server-log": "file:///Users/lloydb/Documents/lws/log",
"local-web-server-mime": "file:///Users/lloydb/Documents/lws/mime",
"local-web-server-rewrite": "file:///Users/lloydb/Documents/lws/rewrite",
"local-web-server-static": "file:///Users/lloydb/Documents/lws/static",
"lws": "^0.8.1"
"lws": "file:///Users/lloydb/Documents/lws/lws"
},
"devDependencies": {}
}
Loading…
Cancel
Save