dito icon indicating copy to clipboard operation
dito copied to clipboard

defaults in app configuration

Open puckey opened this issue 5 years ago • 4 comments

  • env could default to process.env.NODE_ENV when not supplied
  • server.host could default to env.NODE_HOST || env.HOST || '0.0.0.0' when not supplied
  • server.port could default to env.NODE_PORT || env.PORT || 8080 when not supplied
  • log and server could be made optional like app is

puckey avatar Jun 30 '20 08:06 puckey

Good point! Would accept a PR ;)

lehni avatar Sep 22 '20 09:09 lehni

See https://github.com/ditojs/dito/pull/34

I was wondering about logging defaults: how about having some turned on in development and disabling by default in production?

puckey avatar Sep 24 '20 15:09 puckey

Good idea regarding logging defaults. Which ones do you suggest should be on in development by default?

lehni avatar Sep 24 '20 15:09 lehni

We could use the defaults used in dito-example... In production everything is turned off and in development we have:

  log: {
    requests: false,
    routes: false,
    schema: false,
    relations: false,
    sql: false
  },

And how about the app.cors.credentials and admin.api.cors.credentials settings in index.local.js with the comment "Only required for Dito.js Admin development to work on different port:"? Might make sense to add these as a default also?

puckey avatar Sep 25 '20 08:09 puckey