upgrade to the latest lws
This commit is contained in:
@ -2,22 +2,22 @@ const LwsCli = require('lws/lib/cli-app')
|
||||
const path = require('path')
|
||||
|
||||
class WsCli extends LwsCli {
|
||||
execute (options, argv) {
|
||||
const commandLineArgs = require('command-line-args')
|
||||
const cliOptions = commandLineArgs(this.partialDefinitions(), { camelCase: true, partial: true })
|
||||
if (cliOptions.defaultStack) {
|
||||
execute (options) {
|
||||
if (options.defaultStack) {
|
||||
const list = require('./default-stack')
|
||||
this.log(list)
|
||||
} else {
|
||||
options = {
|
||||
stack: require('./default-stack').slice(),
|
||||
moduleDir: path.resolve(__dirname, `../node_modules`),
|
||||
modulePrefix: 'lws-'
|
||||
}
|
||||
return super.execute(options, argv)
|
||||
return super.execute(options)
|
||||
}
|
||||
}
|
||||
|
||||
getDefaultOptions () {
|
||||
return Object.assign(super.getDefaultOptions(), {
|
||||
stack: require('./default-stack').slice(),
|
||||
moduleDir: [ path.resolve(__dirname, '..'), '.' ]
|
||||
})
|
||||
}
|
||||
|
||||
partialDefinitions () {
|
||||
return super.partialDefinitions().concat([
|
||||
{
|
||||
|
@ -2,16 +2,16 @@ module.exports = [
|
||||
'lws-basic-auth',
|
||||
'lws-body-parser',
|
||||
'lws-request-monitor',
|
||||
'lws-log',
|
||||
'lws-cors',
|
||||
'lws-json',
|
||||
// 'lws-log',
|
||||
// 'lws-cors',
|
||||
// 'lws-json',
|
||||
'lws-compress',
|
||||
'lws-rewrite',
|
||||
// 'lws-rewrite',
|
||||
'lws-blacklist',
|
||||
'lws-conditional-get',
|
||||
'lws-mime',
|
||||
'lws-range',
|
||||
'lws-spa',
|
||||
// 'lws-conditional-get',
|
||||
// 'lws-mime',
|
||||
// 'lws-range',
|
||||
// 'lws-spa',
|
||||
'lws-static',
|
||||
'lws-index'
|
||||
]
|
||||
|
Reference in New Issue
Block a user