-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (20 loc) · 675 Bytes
/
app.js
File metadata and controls
25 lines (20 loc) · 675 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
import config from 'config';
import db from './app/database/database';
import express from 'express';
import load from 'express-load';
import bodyParser from 'body-parser';
// global.DB = db;
let app = express();
let dir = process.cwd();
app.use(bodyParser.urlencoded({ extended: false }));
app.set('views', dir + '/dist');
app.use(express.static(dir + '/dist', { index: false }));
load('./app/models')
.then('./app/controllers')
.then('./app/routes')
.into(app);
let server = app.listen(config.get("APP.port"), function () {
let host = server.address().address;
let port = server.address().port;
console.log('Listening at http://%s:%s', host, port);
});