An express-based Node.js web application bootstrapping module.
OTHER License
Bot releases are visible (Hide)
Published by grawk over 4 years ago
Published by gabrielcsapo almost 7 years ago
Core:
lusca
dependency to 1.5.1Add more robust error handler for both inside and outside of the middleware continuation
Set morgan option to log request even if server crashes
Fix occasional double close error on shutdown
Add shutdownHeaders
option to shutdown middleware
Print deprecation warnings for the included 404 and 500 handlers.
Call registered middleware factories with a context set to the method owner. This helps in specific cases (e.g., Passport).
Previously: The factory was called with a context of null
.
Default middleware enabled
to true
. I.e., omitting the enabled
option will still enable the middleware.
Previously: middleware was defaulted enabled
to false
.
Remove the ability to toggle the enabled
state of a middleware at arbitrary points during runtime. Now, a middleware that is not enabled
—by explicitly setting enabled
to false
, given breaking change No.1—will not be require
d (i.e., not parsed), and cannot be enabled at a later time.
Previously: middleware could be toggled. Was by design, but largely unused and caused unanticipated behavior.
Resolve the import
shortstop handler after merging config.json
, [env].json
, and before the other shortstop handlers are resolved.
Previously: import
handler resolved only once, before the rest of the shortstop handlers.
implementation 1, implementation 2, Issue, Pull Request
{ "main": "import:main.json" } // config/config.json { "key": "value", "otherKey": "otherValue" } // config/main.json { "main": { "key": "devValue" } } // config/dev.json { "main": { "key": "devValue", "otherKey": "otherValue" } } // result
Change source priority—from highest to lowest (higher overrides lower)— to: command line arguments, environment variables, [env].json
, config.json
, convenience (environment normalization and env:*
keys).
Previously: source priority order, from highest to lowest, was [env].json
, config.json
, convenience, environment variables, command line arguments.
// config/config.json { "KEY": "fromConfig", "OTHER_KEY": "fromConfig", "THIRD_KEY": "fromConfig" }
OTHER_KEY=fromEnv THIRD_KEY=fromEnv node myApp.js --THIRD_KEY=fromArgv
// result { "KEY": "fromConfig", "OTHER_KEY": "fromEnv", "THIRD_KEY": "fromArgv" }
Print deprecation warnings for the included 404 and 500 handlers.
Call registered middleware factories with a context set to the method owner. This helps in specific cases (e.g., Passport).
Previously: The factory was called with a context of null
.
Default middleware enabled
to true
. I.e., omitting the enabled
option will still enable the middleware.
Previously: middleware was defaulted enabled
to false
.
Remove the ability to toggle the enabled
state of a middleware at arbitrary points during runtime. Now, a middleware that is not enabled
—by explicitly setting enabled
to false
, given breaking change No.1—will not be require
d (i.e., not parsed), and cannot be enabled at a later time.
Previously: middleware could be toggled. Was by design, but largely unused and caused unanticipated behavior.
Resolve the import
shortstop handler after merging config.json
, [env].json
, and before the other shortstop handlers are resolved.
Previously: import
handler resolved only once, before the rest of the shortstop handlers.
implementation 1, implementation 2, Issue, Pull Request
{ "main": "import:main.json" } // config/config.json { "key": "value", "otherKey": "otherValue" } // config/main.json { "main": { "key": "devValue" } } // config/dev.json { "main": { "key": "devValue", "otherKey": "otherValue" } } // result
Change source priority—from highest to lowest (higher overrides lower)— to: command line arguments, environment variables, [env].json
, config.json
, convenience (environment normalization and env:*
keys).
Previously: source priority order, from highest to lowest, was [env].json
, config.json
, convenience, environment variables, command line arguments.
// config/config.json { "KEY": "fromConfig", "OTHER_KEY": "fromConfig", "THIRD_KEY": "fromConfig" }
OTHER_KEY=fromEnv THIRD_KEY=fromEnv node myApp.js --THIRD_KEY=fromArgv
// result { "KEY": "fromConfig", "OTHER_KEY": "fromEnv", "THIRD_KEY": "fromArgv" }
Upstream change regression: respect trust proxy fn
.