aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--app.js2
-rw-r--r--node_simple.js10
3 files changed, 10 insertions, 4 deletions
diff --git a/README.md b/README.md
index e364d16..1528849 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ In order to run the web app locally from your computer please follow the followi
1. Clone the repository into your desired directory from: https://github.com/HumairAK/solutions_repo
2. Make sure node.js and npm are installed on your computer. If not, the easiest way to do this is using Homebrew.
3. Run: npm install from the root directory
-4. Run: node app.js to run the server
+4. Run: NODE_ENV=staging node app.js to run the server
5. Open the browser to http://localhost:3000/
## Usage and Features
diff --git a/app.js b/app.js
index f8e2ab5..9a7aa85 100644
--- a/app.js
+++ b/app.js
@@ -105,7 +105,7 @@ app.use(function(error, req, res, next) {
dbFile.setupDB(function (success, mssg) {
if (success) { // db establiseh
server.listen(port, function(){ // now accept connections
- console.log('listening on port 8080');
+ console.log('listening on port 3000');
});
}
else {
diff --git a/node_simple.js b/node_simple.js
index f07c0e8..13db6c1 100644
--- a/node_simple.js
+++ b/node_simple.js
@@ -103,8 +103,14 @@ var _ = require('underscore');
var db;
// Standard URI format: mongodb://[dbuser:dbpassword@]host:port/dbname
-var uri = exports.uri = 'mongodb://general:assignment4@ds057862.mlab.com:57862/solutions_repo';
-
+if (process.env.NODE_ENV == 'staging') {
+ var uri = exports.uri = 'mongodb://root:solutions_repo@ds023624.mlab.com:23624/solutions_staging';
+} else if (process.env.NODE_ENV == 'production') {
+ var uri = exports.uri = 'mongodb://general:assignment4@ds057862.mlab.com:57862/solutions_repo';
+} else if (process.env.NODE_ENV == 'development') {
+ // Keep this for testing on local machine, do not remove. - Humair
+ //var uri = 'mongodb://localhost:27017/db';
+}
// Keep this for testing on local machine, do not remove. - Humair
//var uri = 'mongodb://localhost:27017/db';