Skip to content

Commit 14b10e1

Browse files
author
Chris Sevilleja
committed
creating files and doing database config
1 parent 5e15320 commit 14b10e1

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

app/routes.js

Whitespace-only changes.

config/database.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
3+
// the database url to connect
4+
url : 'mongodb://node:[email protected]:27017/uwO3mypu'
5+
}

server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ var mongoose = require('mongoose'); // mongoose for mongodb
55

66
var port = process.env.PORT || 8080;
77

8-
// configuration ===============================================================
8+
// load the database config
9+
var database = require('./config/database');
910

10-
mongoose.connect('mongodb://node:[email protected]:27017/uwO3mypu'); // connect to mongoDB database on modulus.io
11+
// configuration ===============================================================
12+
mongoose.connect(database.url); // connect to mongoDB database on modulus.io
1113

1214
app.configure(function() {
1315
app.use(express.static(__dirname + '/public')); // set the static files location /public/img will be /img for users

0 commit comments

Comments
 (0)