0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Move NODE_ENV to service file; remove from server.js and config/default.json

This commit is contained in:
G.Ambatte
2021-01-03 23:57:43 +13:00
parent 8f6270723e
commit 24f5fcb5a0
3 changed files with 2 additions and 3 deletions

View File

@@ -3,5 +3,4 @@
"naturalcrit_url" : "local.naturalcrit.com:8010",
"secret" : "secret",
"web_port" : 8001,
"environment" : "local"
}

View File

@@ -36,6 +36,8 @@ pidfile="/var/run/${program_name}.pid" # File that allows the system to keep
# Env Setup
export HOME=$( getent passwd "homebrewery_runAs" | cut -d: -f6 ) # Gets the home directory of the runAs user
export NODE_ENV="local"
export PORT=8001
# Command Setup
exec_cmd="${location}/${program_name}/server.js" # Path to the HomeBrewery server.js, /usr/local/bin/ when installed globally

View File

@@ -27,8 +27,6 @@ const config = require('nconf')
.file('environment', { file: `config/${process.env.NODE_ENV}.json` })
.file('defaults', { file: 'config/default.json' });
if(!process.env.NODE_ENV) {process.env.NODE_ENV = (config.get('environment') || 'local');}
//DB
const mongoose = require('mongoose');
mongoose.connect(config.get('mongodb_uri') || config.get('mongolab_uri') || 'mongodb://localhost/naturalcrit',