-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.local.js
More file actions
31 lines (25 loc) · 734 Bytes
/
main.local.js
File metadata and controls
31 lines (25 loc) · 734 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
const path = require('path');
const compression = require('compression')
const morgan = require('morgan');
const cors = require('cors');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const history = require('connect-history-api-fallback');
const express = require('express');
const app = express();
const PORT = 8080;
const DIST_FOLDER = path.join(__dirname, 'frontend');
app.use(compression());
app.use(cors());
app.use(helmet());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(morgan('dev'));
app.use(history());
app.use(express.static(DIST_FOLDER));
app.listen(PORT, () => {
console.log('PORT ', PORT);
console.log('SERVER LISTENING');
});