Issues (11)

examples/chat/app.js (1 issue)

Severity
1
import jsonServer from 'json-server';
2
3
const port = process.env.PORT || 3001;
4
const users = [ {
5
    'id'    : 1,
6
    'name'  : 'Leigh',
7
    'email' : '[email protected]'
8
}, {
9
    'id'    : 2,
10
    'name'  : 'Ancell',
11
    'email' : '[email protected]'
12
}, {
13
    'id'    : 3,
14
    'name'  : 'Conre',
15
    'email' : '[email protected]'
16
} ];
17
18
const messages = [ {
19
    text   : 'butter property president flow nodded degree where keep',
20
    sender : 2
21
}, {
22
    text   : 'cheese tried dig interior watch tone time train living',
23
    sender : 1
24
} ];
25
26
const server = jsonServer.create();
27
const router = jsonServer.router({ users, messages });
28
29
server.use(router);
30
31
if (!process.env.TEST) {
32
    server.listen(port, () => {
33
        console.log(`Chat server is running on ${port}`);
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
34
    });
35
}
36
37
export default server;
38