-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
152 lines (145 loc) · 3.73 KB
/
index.js
File metadata and controls
152 lines (145 loc) · 3.73 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
const express = require('express');
const app = express();
const PROT = 3000
//json으로 된 post의 바디를 읽기
app.cors = require('cors')
app.use(ceos());
//json으로 된 post의 바디를 읽기 위해 필요
app.use(express.json())
const personal = [
{
"id": 1,
"name": "홍길동",
"email": "hong@example.com",
"signup_date": "2023-03-18T12:00:00Z"
},
{
"id": 2,
"name": "김철수",
"email": "kim@example.com",
"signup_date": "2023-02-17T09:30:00Z"
},
{
"id": 3,
"name": "이영희",
"email": "lee@example.com",
"signup_date": "2022-11-16T15:20:00Z"
},
{
"id": 4,
"name": "박준호",
"email": "park@example.com",
"signup_date": "2022-10-15T10:10:00Z"
},
{
"id": 5,
"name": "최민수",
"email": "choi@example.com",
"signup_date": "2022-09-14T18:45:00Z"
},
{
"id": 6,
"name": "정다은",
"email": "jung@example.com",
"signup_date": "2022-08-13T14:00:00Z"
},
{
"id": 7,
"name": "김지수",
"email": "kim2@example.com",
"signup_date": "2022-07-12T11:30:00Z"
},
{
"id": 8,
"name": "이수민",
"email": "lee2@example.com",
"signup_date": "2022-06-11T17:15:00Z"
},
{
"id": 9,
"name": "박지현",
"email": "park2@example.com",
"signup_date": "2022-05-10T08:40:00Z"
},
{
"id": 10,
"name": "최지우",
"email": "choi2@example.com",
"signup_date": "2022-04-09T20:00:00Z"
}
]
const posting = [
{
"id": 1,
"title": "첫 번째 게시글 제목",
"content": "첫 번째 게시글 내용입니다.",
"author_id": 1,
"date": "2025-03-18T12:00:00Z"
},
{
"id": 2,
"title": "두 번째 게시글 제목",
"content": "두 번째 게시글 내용입니다.",
"author_id": 2,
"date": "2025-03-17T09:30:00Z"
},
{
"id": 3,
"title": "세 번째 게시글 제목",
"content": "세 번째 게시글 내용입니다.",
"author_id": 3,
"date": "2025-03-16T15:20:00Z"
},
{
"id": 4,
"title": "네 번째 게시글 제목",
"content": "네 번째 게시글 내용입니다.",
"author_id": 4,
"date": "2025-03-15T10:10:00Z"
},
{
"id": 5,
"title": "다섯 번째 게시글 제목",
"content": "다섯 번째 게시글 내용입니다.",
"author_id": 5,
"date": "2025-03-14T18:45:00Z"
},
{
"id": 6,
"title": "여섯 번째 게시글 제목",
"content": "여섯 번째 게시글 내용입니다.",
"author_id": 6,
"date": "2025-03-13T14:00:00Z"
},
{
"id": 7,
"title": "일곱 번째 게시글 제목",
"content": "일곱 번째 게시글 내용입니다.",
"author_id": 7,
"date": "2025-03-12T11:30:00Z"
},
{
"id": 8,
"title": "여덟 번째 게시글 제목",
"content": "여덟 번째 게시글 내용입니다.",
"author_id": 8,
"date": "2025-03-11T17:15:00Z"
},
{
"id": 9,
"title": "아홉 번째 게시글 제목",
"content": "아홉 번째 게시글 내용입니다.",
"author_id": 9,
"date": "2025-03-10T08:40:00Z"
},
{
"id": 10,
"title": "열 번째 게시글 제목",
"content": "열 번째 게시글 내용입니다.",
"author_id": 10,
"date": "2025-03-09T20:00:00Z"
}
]
app.get('/ping', (req, res) => {
res.send('pong');
});