default-stack module
This commit is contained in:
@ -3,22 +3,7 @@ class MiddlewareList {
|
||||
return 'Print available middleware'
|
||||
}
|
||||
execute (options) {
|
||||
const list = [
|
||||
'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'
|
||||
]
|
||||
const list = require('../default-stack')
|
||||
console.log(list)
|
||||
}
|
||||
}
|
||||
|
@ -13,22 +13,7 @@ class WsServe extends ServeCommand {
|
||||
.set('av', require('../../package').version)
|
||||
.set('cd4', 'cli')
|
||||
options = {
|
||||
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'
|
||||
],
|
||||
stack: require('../default-stack'),
|
||||
moduleDir: path.resolve(__dirname, `../../node_modules`),
|
||||
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({
|
||||
moduleDir: path.resolve(__dirname, `../node_modules`),
|
||||
modulePrefix: 'lws-',
|
||||
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'
|
||||
]
|
||||
stack: require('./default-stack')
|
||||
}, options)
|
||||
return super.create(options)
|
||||
}
|
||||
|
Reference in New Issue
Block a user