lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.21k stars 85 forks source link

need ability to specify config file #44

Closed 75lb closed 7 years ago

75lb commented 8 years ago

currently, ws merges config loaded from package.json and/or .local-web-server.json (depending on which exists).

Implement a --config-file (or similar) option to enable the user to specify a config file name. This would be useful for A/B testing, comparing server results using config A against config B.

75lb commented 7 years ago

this is resolved by the --config-file option in v2 which is in progress and available for preview.. any feedback welcome.

Config files are now plain javascipt, giving you freedom to share and merge options however you like. The config file (lws.config.js by default) should look something like this:

module.exports = {
  rewrite: [
    {
      from: '/resources/*',
      to: 'http://remote-api.org:8080/resources/$1'
    }
  ],
  directory: 'src',
  'log.format': 'none'
}
75lb commented 7 years ago

fixed and released in v2.0.0