forked from shakacode/bootstrap-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.prod.js
30 lines (21 loc) · 868 Bytes
/
server.prod.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
25
26
27
28
29
30
/* eslint-disable import/no-extraneous-dependencies, no-console */
const path = require('path');
const express = require('express');
const bodyParser = require('body-parser');
const IP = process.env.IP || 'localhost';
const PORT = process.env.PORT || 4000;
const server = express();
server.use(bodyParser.json());
server.use(bodyParser.urlencoded({ extended: true }));
server.use(express.static(path.join(__dirname, 'public')));
server.get('/', (_req, res) => res.redirect('/bs3'));
server.get('/bs3', (_req, res) =>
res.sendFile(path.join(__dirname, 'app', 'markup', 'bs3-prod.html')),
);
server.get('/bs4', (_req, res) =>
res.sendFile(path.join(__dirname, 'app', 'markup', 'bs4-prod.html')),
);
server.listen(PORT, IP, err => {
if (err) console.log(`=> OMG!!! 🙀 ${err}`);
console.log(`=> 🚀 Production server is running on port ${PORT}`);
});