mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
hardened configuration
- moved env rewrite + dotenv code to single location - fixed bug with system flag on user
This commit is contained in:
@@ -2,17 +2,8 @@
|
||||
// application. All defaults are assumed here, validation should also be
|
||||
// completed here.
|
||||
|
||||
// Perform rewrites to the runtime environment variables based on the contents
|
||||
// of the process.env.REWRITE_ENV if it exists. This is done here as it is the
|
||||
// entrypoint for the entire applications configuration.
|
||||
require('env-rewrite').rewrite();
|
||||
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
|
||||
// Apply all the configuration provided in the .env file if it isn't already
|
||||
// in the environment.
|
||||
require('dotenv').config();
|
||||
}
|
||||
// Setup the environment.
|
||||
require('./services/env');
|
||||
|
||||
const uniq = require('lodash/uniq');
|
||||
const ms = require('ms');
|
||||
|
||||
Reference in New Issue
Block a user