-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
32 lines (27 loc) · 713 Bytes
/
server.js
File metadata and controls
32 lines (27 loc) · 713 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
32
const express = require('express');
const compression = require('compression');
const winston = require('winston');
const app = express();
winston.format.combine(
winston.format.colorize(),
winston.format.json()
);
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
defaultMeta: { service: 'user-service' },
transports: [
new winston.transports.Console({
format: winston.format.simple()
})
]
});
app.use(compression());
app.use(express.static(__dirname + '/dist'));
app.get('/info', (req, res) => {
res.json({
viewSystem: 'React',
architecture: 'Redux',
});
});
app.listen(8080, () => logger.info('App running on port 8080 o//'));