Browse Source

more middleware

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

2
lib/local-web-server.js

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

2
package.json

@ -46,7 +46,9 @@
"local-web-server-json": "file:///Users/lloydb/Documents/lws/json", "local-web-server-json": "file:///Users/lloydb/Documents/lws/json",
"local-web-server-log": "file:///Users/lloydb/Documents/lws/log", "local-web-server-log": "file:///Users/lloydb/Documents/lws/log",
"local-web-server-mime": "file:///Users/lloydb/Documents/lws/mime", "local-web-server-mime": "file:///Users/lloydb/Documents/lws/mime",
"local-web-server-mock-response": "file:///Users/lloydb/Documents/lws/mock-response",
"local-web-server-rewrite": "file:///Users/lloydb/Documents/lws/rewrite", "local-web-server-rewrite": "file:///Users/lloydb/Documents/lws/rewrite",
"local-web-server-spa": "file:///Users/lloydb/Documents/lws/spa",
"local-web-server-static": "file:///Users/lloydb/Documents/lws/static", "local-web-server-static": "file:///Users/lloydb/Documents/lws/static",
"lws": "file:///Users/lloydb/Documents/lws/lws" "lws": "file:///Users/lloydb/Documents/lws/lws"
}, },

Loading…
Cancel
Save