mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 21:02:43 +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",
|
"naturalcrit_url" : "local.naturalcrit.com:8010",
|
||||||
"secret" : "secret",
|
"secret" : "secret",
|
||||||
"web_port" : 8001,
|
"web_port" : 8001,
|
||||||
"environment" : "local"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ pidfile="/var/run/${program_name}.pid" # File that allows the system to keep
|
|||||||
|
|
||||||
# Env Setup
|
# Env Setup
|
||||||
export HOME=$( getent passwd "homebrewery_runAs" | cut -d: -f6 ) # Gets the home directory of the runAs user
|
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
|
# Command Setup
|
||||||
exec_cmd="${location}/${program_name}/server.js" # Path to the HomeBrewery server.js, /usr/local/bin/ when installed globally
|
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('environment', { file: `config/${process.env.NODE_ENV}.json` })
|
||||||
.file('defaults', { file: 'config/default.json' });
|
.file('defaults', { file: 'config/default.json' });
|
||||||
|
|
||||||
if(!process.env.NODE_ENV) {process.env.NODE_ENV = (config.get('environment') || 'local');}
|
|
||||||
|
|
||||||
//DB
|
//DB
|
||||||
const mongoose = require('mongoose');
|
const mongoose = require('mongoose');
|
||||||
mongoose.connect(config.get('mongodb_uri') || config.get('mongolab_uri') || 'mongodb://localhost/naturalcrit',
|
mongoose.connect(config.get('mongodb_uri') || config.get('mongolab_uri') || 'mongodb://localhost/naturalcrit',
|
||||||
|
|||||||
Reference in New Issue
Block a user