Skip to content

Change the interface for setting application settings #4099

@hacksparrow

Description

@hacksparrow

The interface app.set(<name with space>, <value>) feels a odd for setting values in a JavaScript framework. Also, its counterpart app.get(<name>) is a confusing twin of app.get(path, callback [, callback ...]), which is a router method.

I am proposing to implement application settings using getter-setter interfaces.

app.settings.trustProxy = true;

And get rid of app.get(<name>).

Super major change, I know, but the next major version is a good time to make these interface improvements.

Related issues

  1. remove .get() and .set() functions for settings #2216
  2. app.set() JSON style #3997

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions