diff options
| author | kumar dam <kumar.damani@mail.utoronto.ca> | 2017-04-30 01:38:53 +0000 |
|---|---|---|
| committer | kumar dam <kumar.damani@mail.utoronto.ca> | 2017-04-30 01:38:53 +0000 |
| commit | fb06a6490e1abcb56d2ca11a7e1ad812dceb943f (patch) | |
| tree | 9eed1c89a5c4b7e568e52a1473e24d0d520a672d /server.js | |
| parent | d52437a4f88af931f130c7bb259949a84db65276 (diff) | |
fixed all indents
Diffstat (limited to 'server.js')
| -rw-r--r-- | server.js | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,25 +1,26 @@ // set up the app var express = require('express'); var app = express(); -var mongoose = require('mongoose'); // for mongodb -var port = process.env.PORT || 3000; // the port -// var database = require('./config/database'); // load the database configuration (uri) +var mongoose = require('mongoose'); // for mongodb +var port = process.env.PORT || 3000; // the port +// var database = require('./config/database'); // load the database configuration (uri) // var morgan = require('morgan'); // for debugging var bodyParser = require('body-parser'); // for ease of use var methodOverride = require('method-override'); // just in case // set up for functionality -mongoose.connect('mongodb://test:admin@ds139665.mlab.com:39665/to_list'); // connect to mongodb -// mongoose.connect('mongodb://localhost/2701'); // connect to mongodb +mongoose.connect('mongodb://test:admin@ds139665.mlab.com:39665/to_list'); // connect to mongodb +// mongoose.connect('mongodb://localhost/2701'); // connect to mongodb -app.use(express.static('./public')); // set the static files location /public/img will be /img for users +// set the static files location /public/img will be /img for users +app.use(express.static('./public')); // app.use(morgan('dev')); // log every request to the console app.use(bodyParser.urlencoded({'extended': 'true'})); // parse application ...url app.use(bodyParser.json()); // parse application/json app.use(bodyParser.json({type: 'application/vnd.api+json'})); // parse application/vnd.api+json as json -app.use(methodOverride('X-HTTP-Method-Override')); // override with the X-HTTP-Method-Override header in the request - +// override with the X-HTTP-Method-Override header in the request +app.use(methodOverride('X-HTTP-Method-Override')); // connect with api require('./app/routes.js')(app); @@ -27,4 +28,3 @@ require('./app/routes.js')(app); app.listen(port); console.log("Listening on port " + port); - |
