You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
800 B
34 lines
800 B
const Lws = require('lws')
|
|
const path = require('path')
|
|
|
|
class LocalWebServer extends Lws {
|
|
create (options) {
|
|
const usage = require('lws/lib/usage')
|
|
usage.defaults
|
|
.set('an', 'ws')
|
|
.set('av', require('../package').version)
|
|
.set('cd4', 'api')
|
|
options = Object.assign({
|
|
moduleDir: path.resolve(__dirname, `../node_modules`),
|
|
modulePrefix: 'lws-',
|
|
stack: [
|
|
'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)
|
|
return super.create(options)
|
|
}
|
|
}
|
|
|
|
module.exports = LocalWebServer
|