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

8 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
  7. .set('an', 'ws')
  8. .set('av', require('../package').version)
  9. .set('cd4', 'api')
  10. options = Object.assign({
  11. moduleDir: path.resolve(__dirname, `../node_modules`),
  12. modulePrefix: 'lws-',
  13. stack: [
  14. 'lws-log',
  15. 'lws-cors',
  16. 'lws-json',
  17. 'lws-rewrite',
  18. 'lws-body-parser',
  19. 'lws-blacklist',
  20. 'lws-conditional-get',
  21. 'lws-mime',
  22. 'lws-compress',
  23. 'lws-mock-response',
  24. 'lws-spa',
  25. 'lws-static',
  26. 'lws-index'
  27. ]
  28. }, options)
  29. return super.create(options)
  30. }
  31. }
  32. module.exports = LocalWebServer