server.js
961 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
33
34
35
36
37
38
39
40
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = process.env.PORT || 5000;
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ exrended : true }));
app.get('/api/customers', (req, res) => {
res.send([
{
'id': 1,
'image': 'https://placeimg.com/64/64/any',
'name': '이혜연',
'birthday': '000416',
'gender': '여자',
'job': '대학생'
},
{
'id': 2,
'image': 'https://placeimg.com/64/64/2',
'name': '김다은',
'birthday': '000101',
'gender': '여자',
'job': '재수생'
},
{
'id': 3,
'image': 'https://placeimg.com/64/64/3',
'name': '김석희',
'birthday': '900103',
'gender': '남자',
'job': '회사원'
}
])
})
app.listen(port, () => console.log(`Listening on port ${port}`));