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.

70 lines
2.7 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. module.exports = {
  2. definitions: [
  3. {
  4. name: 'port', alias: 'p', type: Number, defaultOption: true,
  5. description: 'Web server port.', group: 'server'
  6. },
  7. {
  8. name: 'directory', alias: 'd', type: String, typeLabel: '[underline]{path}',
  9. description: 'Root directory, defaults to the current directory.', group: 'server'
  10. },
  11. {
  12. name: 'log-format', alias: 'f', type: String,
  13. description: "If a format is supplied an access log is written to stdout. If not, a dynamic statistics view is displayed. Use a preset ('none', 'dev','combined', 'short', 'tiny' or 'logstalgia') or supply a custom format (e.g. ':method -> :url').", group: 'server'
  14. },
  15. {
  16. name: 'rewrite', alias: 'r', type: String, multiple: true, typeLabel: '[underline]{expression} ...',
  17. description: "A list of URL rewrite rules. For each rule, separate the 'from' and 'to' routes with '->'. Whitespace surrounded the routes is ignored. E.g. '/from -> /to'.", group: 'server'
  18. },
  19. {
  20. name: 'spa', alias: 's', type: String, typeLabel: '[underline]{file}',
  21. description: 'Path to a Single Page App, e.g. app.html.', group: 'server'
  22. },
  23. {
  24. name: 'compress', alias: 'c', type: Boolean,
  25. description: 'Serve gzip-compressed resources, where applicable.', group: 'server'
  26. },
  27. {
  28. name: 'forbid', alias: 'b', type: String, multiple: true, typeLabel: '[underline]{path} ...',
  29. description: 'A list of forbidden routes.', group: 'server'
  30. },
  31. {
  32. name: 'no-cache', alias: 'n', type: Boolean,
  33. description: 'Disable etag-based caching - forces loading from disk each request.', group: 'server'
  34. },
  35. {
  36. name: 'key', type: String, typeLabel: '[underline]{file}', group: 'server',
  37. description: 'SSL key, required for https.'
  38. },
  39. {
  40. name: 'cert', type: String, typeLabel: '[underline]{file}', group: 'server',
  41. description: 'SSL cert, required for https.'
  42. },
  43. {
  44. name: 'verbose', type: Boolean,
  45. description: 'Verbose output, useful for debugging.', group: 'server'
  46. },
  47. {
  48. name: 'help', alias: 'h', type: Boolean,
  49. description: 'Print these usage instructions.', group: 'misc'
  50. },
  51. {
  52. name: 'config', type: Boolean,
  53. description: 'Print the stored config.', group: 'misc'
  54. }
  55. ],
  56. usageData: {
  57. title: 'local-web-server',
  58. description: 'A simple web-server for productive front-end development.',
  59. footer: 'Project home: [underline]{https://github.com/75lb/local-web-server}',
  60. synopsis: [
  61. '$ ws [<server options>]',
  62. '$ ws --config',
  63. '$ ws --help'
  64. ],
  65. groups: {
  66. server: 'Server',
  67. misc: 'Misc'
  68. }
  69. }
  70. }