default-stack module
This commit is contained in:
@ -3,22 +3,7 @@ class MiddlewareList {
|
|||||||
return 'Print available middleware'
|
return 'Print available middleware'
|
||||||
}
|
}
|
||||||
execute (options) {
|
execute (options) {
|
||||||
const list = [
|
const list = require('../default-stack')
|
||||||
'lws-request-monitor',
|
|
||||||
'lws-log',
|
|
||||||
'lws-cors',
|
|
||||||
'lws-json',
|
|
||||||
'lws-rewrite',
|
|
||||||
'lws-body-parser',
|
|
||||||
'lws-blacklist',
|
|
||||||
'lws-conditional-get',
|
|
||||||
'lws-mime',
|
|
||||||
'lws-compress',
|
|
||||||
'lws-mock-response',
|
|
||||||
'lws-spa',
|
|
||||||
'lws-static',
|
|
||||||
'lws-index'
|
|
||||||
]
|
|
||||||
console.log(list)
|
console.log(list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,22 +13,7 @@ class WsServe extends ServeCommand {
|
|||||||
.set('av', require('../../package').version)
|
.set('av', require('../../package').version)
|
||||||
.set('cd4', 'cli')
|
.set('cd4', 'cli')
|
||||||
options = {
|
options = {
|
||||||
stack: [
|
stack: require('../default-stack'),
|
||||||
'lws-request-monitor',
|
|
||||||
'lws-log',
|
|
||||||
'lws-cors',
|
|
||||||
'lws-json',
|
|
||||||
'lws-rewrite',
|
|
||||||
'lws-body-parser',
|
|
||||||
'lws-blacklist',
|
|
||||||
'lws-conditional-get',
|
|
||||||
'lws-mime',
|
|
||||||
'lws-compress',
|
|
||||||
'lws-mock-response',
|
|
||||||
'lws-spa',
|
|
||||||
'lws-static',
|
|
||||||
'lws-index'
|
|
||||||
],
|
|
||||||
moduleDir: path.resolve(__dirname, `../../node_modules`),
|
moduleDir: path.resolve(__dirname, `../../node_modules`),
|
||||||
modulePrefix: 'lws-'
|
modulePrefix: 'lws-'
|
||||||
}
|
}
|
||||||
|
16
lib/default-stack.js
Normal file
16
lib/default-stack.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
module.exports = [
|
||||||
|
'lws-body-parser',
|
||||||
|
'lws-request-monitor',
|
||||||
|
'lws-log',
|
||||||
|
'lws-cors',
|
||||||
|
'lws-json',
|
||||||
|
'lws-rewrite',
|
||||||
|
'lws-blacklist',
|
||||||
|
'lws-conditional-get',
|
||||||
|
'lws-mime',
|
||||||
|
'lws-compress',
|
||||||
|
'lws-mock-response',
|
||||||
|
'lws-spa',
|
||||||
|
'lws-static',
|
||||||
|
'lws-index'
|
||||||
|
]
|
@ -11,22 +11,7 @@ class LocalWebServer extends Lws {
|
|||||||
options = Object.assign({
|
options = Object.assign({
|
||||||
moduleDir: path.resolve(__dirname, `../node_modules`),
|
moduleDir: path.resolve(__dirname, `../node_modules`),
|
||||||
modulePrefix: 'lws-',
|
modulePrefix: 'lws-',
|
||||||
stack: [
|
stack: require('./default-stack')
|
||||||
'lws-request-monitor',
|
|
||||||
'lws-log',
|
|
||||||
'lws-cors',
|
|
||||||
'lws-json',
|
|
||||||
'lws-rewrite',
|
|
||||||
'lws-body-parser',
|
|
||||||
'lws-blacklist',
|
|
||||||
'lws-conditional-get',
|
|
||||||
'lws-mime',
|
|
||||||
'lws-compress',
|
|
||||||
'lws-mock-response',
|
|
||||||
'lws-spa',
|
|
||||||
'lws-static',
|
|
||||||
'lws-index'
|
|
||||||
]
|
|
||||||
}, options)
|
}, options)
|
||||||
return super.create(options)
|
return super.create(options)
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"lws-json": "^0.3.2",
|
"lws-json": "^0.3.2",
|
||||||
"lws-log": "^0.3.0",
|
"lws-log": "^0.3.0",
|
||||||
"lws-mime": "^0.2.1",
|
"lws-mime": "^0.2.1",
|
||||||
"lws-mock-response": "^0.2.3",
|
"lws-mock-response": "^0.2.4",
|
||||||
"lws-request-monitor": "^0.1.0",
|
"lws-request-monitor": "^0.1.0",
|
||||||
"lws-rewrite": "^0.3.4",
|
"lws-rewrite": "^0.3.4",
|
||||||
"lws-spa": "^0.2.2",
|
"lws-spa": "^0.2.2",
|
||||||
|
Reference in New Issue
Block a user