From 3041b4f858fc8aa5cb13f9f543203a2d149ace37 Mon Sep 17 00:00:00 2001 From: Kieu Anh Tuan Date: Thu, 7 Nov 2013 18:41:05 +0100 Subject: [PATCH] Use module export instead of json string so that we can use environment variable for credentials info --- config/config.js | 2 +- config/env/development.js | 26 ++++++++++++++++++++++++++ config/env/development.json | 26 -------------------------- config/env/production.js | 26 ++++++++++++++++++++++++++ config/env/production.json | 26 -------------------------- config/env/test.js | 27 +++++++++++++++++++++++++++ config/env/test.json | 27 --------------------------- 7 files changed, 80 insertions(+), 80 deletions(-) create mode 100644 config/env/development.js delete mode 100644 config/env/development.json create mode 100644 config/env/production.js delete mode 100644 config/env/production.json create mode 100644 config/env/test.js delete mode 100644 config/env/test.json diff --git a/config/config.js b/config/config.js index 69504d5ad0..d3394b4e78 100644 --- a/config/config.js +++ b/config/config.js @@ -4,4 +4,4 @@ var _ = require('underscore'); module.exports = _.extend( require(__dirname + '/../config/env/all.js'), - require(__dirname + '/../config/env/' + process.env.NODE_ENV + '.json') || {}); \ No newline at end of file + require(__dirname + '/../config/env/' + process.env.NODE_ENV + '.js') || {}); diff --git a/config/env/development.js b/config/env/development.js new file mode 100644 index 0000000000..656ffbaabf --- /dev/null +++ b/config/env/development.js @@ -0,0 +1,26 @@ +module.exports = { + db: "mongodb://localhost/mean-dev", + app: { + name: "MEAN - A Modern Stack - Development" + }, + facebook: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/facebook/callback" + }, + twitter: { + clientID: "CONSUMER_KEY", + clientSecret: "CONSUMER_SECRET", + callbackURL: "http://localhost:3000/auth/twitter/callback" + }, + github: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/github/callback" + }, + google: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/google/callback" + } +} \ No newline at end of file diff --git a/config/env/development.json b/config/env/development.json deleted file mode 100644 index cc3055f415..0000000000 --- a/config/env/development.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "db": "mongodb://localhost/mean-dev", - "app": { - "name": "MEAN - A Modern Stack - Development" - }, - "facebook": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/facebook/callback" - }, - "twitter": { - "clientID": "CONSUMER_KEY", - "clientSecret": "CONSUMER_SECRET", - "callbackURL": "http://localhost:3000/auth/twitter/callback" - }, - "github": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/github/callback" - }, - "google": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/google/callback" - } -} \ No newline at end of file diff --git a/config/env/production.js b/config/env/production.js new file mode 100644 index 0000000000..8683ef3b2f --- /dev/null +++ b/config/env/production.js @@ -0,0 +1,26 @@ +module.exports = { + db: "mongodb://localhost/mean", + app: { + name: "MEAN - A Modern Stack - Production" + }, + facebook: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/facebook/callback" + }, + twitter: { + clientID: "CONSUMER_KEY", + clientSecret: "CONSUMER_SECRET", + callbackURL: "http://localhost:3000/auth/twitter/callback" + }, + github: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/github/callback" + }, + google: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/google/callback" + } +} \ No newline at end of file diff --git a/config/env/production.json b/config/env/production.json deleted file mode 100644 index f12ffb51e0..0000000000 --- a/config/env/production.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "db": "mongodb://localhost/mean", - "app": { - "name": "MEAN - A Modern Stack - Production" - }, - "facebook": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/facebook/callback" - }, - "twitter": { - "clientID": "CONSUMER_KEY", - "clientSecret": "CONSUMER_SECRET", - "callbackURL": "http://localhost:3000/auth/twitter/callback" - }, - "github": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/github/callback" - }, - "google": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/google/callback" - } -} \ No newline at end of file diff --git a/config/env/test.js b/config/env/test.js new file mode 100644 index 0000000000..257ccb7c9a --- /dev/null +++ b/config/env/test.js @@ -0,0 +1,27 @@ +module.exports = { + db: "mongodb://localhost/mean-test", + port: 3001, + app: { + name: "MEAN - A Modern Stack - Test" + }, + facebook: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/facebook/callback" + }, + twitter: { + clientID: "CONSUMER_KEY", + clientSecret: "CONSUMER_SECRET", + callbackURL: "http://localhost:3000/auth/twitter/callback" + }, + github: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/github/callback" + }, + google: { + clientID: "APP_ID", + clientSecret: "APP_SECRET", + callbackURL: "http://localhost:3000/auth/google/callback" + } +} \ No newline at end of file diff --git a/config/env/test.json b/config/env/test.json deleted file mode 100644 index 9fa16467ce..0000000000 --- a/config/env/test.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "db": "mongodb://localhost/mean-test", - "port": 3001, - "app": { - "name": "MEAN - A Modern Stack - Test" - }, - "facebook": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/facebook/callback" - }, - "twitter": { - "clientID": "CONSUMER_KEY", - "clientSecret": "CONSUMER_SECRET", - "callbackURL": "http://localhost:3000/auth/twitter/callback" - }, - "github": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/github/callback" - }, - "google": { - "clientID": "APP_ID", - "clientSecret": "APP_SECRET", - "callbackURL": "http://localhost:3000/auth/google/callback" - } -} \ No newline at end of file