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.

41 lines
836 B

9 years ago
9 years ago
8 years ago
8 years ago
  1. 'use strict'
  2. const Lws = require('lws')
  3. /**
  4. * @module local-web-server
  5. */
  6. /**
  7. * @alias module:local-web-server
  8. */
  9. class LocalWebServer extends Lws {
  10. constructor () {
  11. const path = require('path')
  12. const stack = [
  13. 'lws-log',
  14. 'lws-cors',
  15. 'lws-json',
  16. 'lws-rewrite',
  17. 'lws-body-parser',
  18. 'lws-blacklist',
  19. 'lws-conditional-get',
  20. 'lws-mime',
  21. 'lws-compress',
  22. 'lws-mock-response',
  23. 'lws-spa',
  24. 'lws-static',
  25. 'lws-index'
  26. ].map(name => {
  27. return path.resolve(__dirname, `../node_modules/${name}`)
  28. })
  29. super({ stack, 'config-name': 'local-web-server' })
  30. }
  31. getVersion () {
  32. const path = require('path')
  33. const pkg = require(path.resolve(__dirname, '..', 'package.json'))
  34. return pkg.version
  35. }
  36. }
  37. module.exports = LocalWebServer