diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | app.js | 2 | ||||
| -rw-r--r-- | node_simple.js | 10 |
3 files changed, 10 insertions, 4 deletions
@@ -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 @@ -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 2f49360..0ccf76a 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 (NODE_ENV == 'staging') { + var uri = exports.uri = 'mongodb://root:solutions_repo@ds023624.mlab.com:23624/solutions_staging'; +} else if (NODE_ENV == 'production') { + var uri = exports.uri = 'mongodb://general:assignment4@ds057862.mlab.com:57862/solutions_repo'; +} else if (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'; |
