-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
24 lines (19 loc) · 646 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const express = require('express');
const bodyParser = require('body-parser');
const config = require('./src/configs/configs');
const routerNav = require('./src/index');
const logger = require('morgan');
const app = express();
const port = config.port;
const path = require('path');
const cors = require('cors');
app.listen(port, function() {
console.log(`Server Listening on port ${port}`);
});
app.use('/src/images', express.static(path.join(__dirname, '/src/images')));
app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use('/', routerNav);
app.use(logger('dev'));
module.exports = app;