mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 19:22:47 +00:00
Add local_environments to configuration files
Add `local` parameter to global `config` object to avoid repeating tests JWT key `secret` only added to global object `config` when local installation detected
This commit is contained in:
@@ -262,9 +262,16 @@ app.get('/print/:id', asyncHandler(async (req, res, next)=>{
|
||||
//Render the page
|
||||
const templateFn = require('./../client/template.js');
|
||||
app.use((req, res)=>{
|
||||
// Create configuration object
|
||||
const configuration = {
|
||||
environment : config.get('node_env'),
|
||||
secret : config.get('secret')
|
||||
local : false,
|
||||
environment : config.get('node_env')
|
||||
};
|
||||
// Add local only items to configuration object
|
||||
const localEnvironments = config.get('local_environments');
|
||||
if(localEnvironments.includes(configuration.environment)){
|
||||
configuration.local = true;
|
||||
configuration.secret = config.get('secret');
|
||||
};
|
||||
const props = {
|
||||
version : require('./../package.json').version,
|
||||
|
||||
Reference in New Issue
Block a user