-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
24 lines (17 loc) · 671 Bytes
/
app.js
File metadata and controls
24 lines (17 loc) · 671 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
// Adding seed data
const express = require('express');
const app = express();
const mongoose = require('mongoose');
const config = require('./config');
const setupController = require('./controllers/setupController');
const apiController = require('./controllers/apiController');
var port = process.env.PORT || 3000;
app.use( '/', express.static( __dirname + '/public' ) );
app.use('/assets', express.static( __dirname +
'/public' ));
app.set( 'view engine', 'ejs' );
console.log('CONN =', config.getDbConnectionString() );
mongoose.connect(config.getDbConnectionString(), { useNewUrlParser: true } );
setupController(app);
apiController(app);
app.listen(port);