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:
@@ -3,5 +3,4 @@
|
||||
"naturalcrit_url" : "local.naturalcrit.com:8010",
|
||||
"secret" : "secret",
|
||||
"web_port" : 8001,
|
||||
"environment" : "local"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user