forked from juliancantillo/calidev-mongodb-geospatial-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
32 lines (22 loc) · 667 Bytes
/
app.js
File metadata and controls
32 lines (22 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
var express = require('express');
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
var app = express();
mongoose.connect('mongodb://localhost/calidev-dev', {
db: {
safe: true
}
});
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
require('./routes')(app);
app.get('/', function (req, res) {
res.sendFile(__dirname + '/app.html');
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Geomanzr app listening at http://%s:%s', host, port);
});
exports = module.exports = app;