From 067f428f6f0b320ec674c4ad4d6784fd987db4a3 Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Sun, 4 Dec 2016 09:08:51 +0800 Subject: [PATCH] rolled back configuration file to project --- src/web_console/.gitignore | 1 - .../configuration/system_configs.js | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/web_console/configuration/system_configs.js diff --git a/src/web_console/.gitignore b/src/web_console/.gitignore index c3df920..c37ce6b 100644 --- a/src/web_console/.gitignore +++ b/src/web_console/.gitignore @@ -4,6 +4,5 @@ logs/ tools/ node_modules/ bower_components/ -configuration/ *.DS_Store nohup.out \ No newline at end of file diff --git a/src/web_console/configuration/system_configs.js b/src/web_console/configuration/system_configs.js new file mode 100644 index 0000000..e73d858 --- /dev/null +++ b/src/web_console/configuration/system_configs.js @@ -0,0 +1,53 @@ +/** + * Created by strawmanbobi + * 2014-10-17 + */ + +require('../mini_poem/configuration/constants'); +var Enums = require('./../constants/enums'); +var enums = new Enums(); + +exports.setupEnvironment = function () { + var env = process.env.NODE_ENV || 'development'; + ENV = env; + if (undefined == typeof env || null == env || "" == env || enums.APP_PRODUCTION_MODE == env) { + MYSQL_DB_SERVER_ADDRESS = "root"; + MYSQL_DB_NAME = "irext"; + MYSQL_DB_USER = "root"; + MYSQL_DB_PASSWORD = "root"; + FILE_TEMP_PATH = "~/home/strawmanbobi/rc_extension"; + PYTHON_PATH = "/usr/bin/python"; + LISTEN_PORT = "8300"; + MAIN_SERVER_ADDRESS = "localhost"; + MAIN_SERVER_PORT = 80; + REDIS_HOST = "localhost"; + REDIS_PORT = "6379"; + REDIS_PASSWORD = ""; + } else if (enums.APP_DEVELOPMENT_MODE == env) { + MYSQL_DB_SERVER_ADDRESS = "localhost"; + MYSQL_DB_NAME = "irext"; + MYSQL_DB_USER = "root"; + MYSQL_DB_PASSWORD = "root"; + FILE_TEMP_PATH = "D:/rc_extension"; + PYTHON_PATH = "C:/Python27/python.exe"; + LISTEN_PORT = "8300"; + MAIN_SERVER_ADDRESS = "localhost"; + MAIN_SERVER_PORT = 80; + REDIS_HOST = "localhost"; + REDIS_PORT = "6379"; + REDIS_PASSWORD = ""; + } else if (enums.APP_USERDEBUG_MODE == env) { + MYSQL_DB_SERVER_ADDRESS = "localhost"; + MYSQL_DB_NAME = "irext"; + MYSQL_DB_USER = "root"; + MYSQL_DB_PASSWORD = "root"; + FILE_TEMP_PATH = "D:/rc_extension"; + PYTHON_PATH = "/usr/bin/python"; + LISTEN_PORT = "8300"; + MAIN_SERVER_ADDRESS = "localhost"; + MAIN_SERVER_PORT = 80; + REDIS_HOST = "localhost"; + REDIS_PORT = "6379"; + REDIS_PASSWORD = ""; + } +}; \ No newline at end of file