forked from jameslmartin/docker-node-mongo-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
21 lines (16 loc) · 518 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function p(d) {
console.log(d);
}
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var expressMongoDb = require('express-mongo-db');
app.use(express.static(__dirname + '/public'));
// pass along connection to db to controllers
app.use(expressMongoDb('mongodb://mongo:27017/app'));
app.use(bodyParser.json());
var users = require('./routes/User.js');
app.use('/users', users);
var server = app.listen('8080', function() {
p('Express server listening on 8080');
});