lwsjs / local-web-server

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

Override config file arguments from CLI #176

Open ghenadiibatalski opened 1 year ago

ghenadiibatalski commented 1 year ago

Hello and thank you for this wonderful product! I'm facing a problem, that i need to override at least the --directory from a command line even if this is already configured via the config file. Could you please make a CLI arguments a higher precedence over the config file?

Thanks and kind regards, Gena

75lb commented 1 year ago

Hi, yes this looks like a bug.. if you set the --config flag you can inspect the config that ws is using, e.g.

$ ws --port 8030 --config
{
  port: 8030,
  stack: MiddlewareStack(3) [ LwsAuth, Static ],
  view: CliView {}
}

Do you find that the --config output is correct but is not being respected? I imagine this is a quick fix, will look into it..