-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
39 lines (32 loc) · 942 Bytes
/
app.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
31
32
33
34
35
36
37
38
39
import express from "express";
import http from "http";
import bodyParser from "body-parser";
import reserveMasterkey from "./src/masterkey/run.js";
const app = express();
app.use(express.json({ extended: true }));
app.use(bodyParser.urlencoded({ extended: false }));
const server = http.createServer(app);
const PORT = 3000;
app.post("/reserve/masterkey", async (req, res) => {
const info = req.body;
console.log("request:", info);
const response = await reserveMasterkey(info);
console.log("respone:", response);
res.json({
isSucceed: response,
});
});
server.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}`);
});
/**
info 객체 예시
{
"targetUrl": "https://www.master-key.co.kr/booking/bk_detail?bid=11",
"themeTitle": "연애조작단",
"targetDate": "2023-11-25",
"targetTime": "99:05",
"bookerName": "이남곤",
"bookerPhoneNumber": "01012345678"
}
*/