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.

32 lines
757 B

7 years ago
  1. const Lws = require('lws')
  2. const path = require('path')
  3. class LocalWebServer extends Lws {
  4. create (options) {
  5. const usage = require('lws/lib/usage')
  6. usage.defaults.set('an', 'ws')
  7. usage.defaults.set('cd4', 'api')
  8. options = Object.assign({
  9. moduleDir: path.resolve(__dirname, `../node_modules`),
  10. modulePrefix: 'lws-',
  11. stack: [
  12. 'lws-log',
  13. 'lws-cors',
  14. 'lws-json',
  15. 'lws-rewrite',
  16. 'lws-body-parser',
  17. 'lws-blacklist',
  18. 'lws-conditional-get',
  19. 'lws-mime',
  20. 'lws-compress',
  21. 'lws-mock-response',
  22. 'lws-spa',
  23. 'lws-static',
  24. 'lws-index'
  25. ]
  26. }, options)
  27. return super.create(options)
  28. }
  29. }
  30. module.exports = LocalWebServer