From d804d742d90e9cca9a6af884937316931fd964d6 Mon Sep 17 00:00:00 2001 From: jihwooon Date: Mon, 25 Mar 2024 12:47:37 +0900 Subject: [PATCH 1/2] =?UTF-8?q?server-node/package.json=20=EC=97=85?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=8A=B8=20(=EB=B9=8C=EB=93=9C=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새로운 스크립트 추가: "build": "tsc" - 기존 시작 스크립트 "start": "tsx watch -r dotenv/config src/index.ts"은 변경되지 않았습니다. --- server-node/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server-node/package.json b/server-node/package.json index 7f4d5ca..a5e0e36 100644 --- a/server-node/package.json +++ b/server-node/package.json @@ -12,7 +12,8 @@ "test": "jest --runInBand --detectOpenHandles --forceExit", "test:only-changed": "jest --runInBand --onlyChanged", "test:watch": "jest --watch --runInBand --detectOpenHandles --forceExit", - "start": "tsx watch -r dotenv/config src/index.ts" + "start": "tsx watch -r dotenv/config src/index.ts", + "build": "tsc" }, "keywords": [], "author": "", From 7ce2ef3c7a901cb029478968305ebd5422cde94b Mon Sep 17 00:00:00 2001 From: jihwooon Date: Mon, 25 Mar 2024 12:49:45 +0900 Subject: [PATCH 2/2] =?UTF-8?q?health=20check=20=EC=97=94=EB=93=9C?= =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새로운 라우터 생성: server-node/src/routers/healthCheck.router.ts - /healthcheck 경로에 GET 요청을 처리 - "OK" 응답 반환 - 앱에 라우터 등록: server-node/src/app.ts - app.use(healthCheckRouter) 추가 --- server-node/src/app.ts | 2 ++ server-node/src/routers/healthCheck.router.ts | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 server-node/src/routers/healthCheck.router.ts diff --git a/server-node/src/app.ts b/server-node/src/app.ts index 55f51e5..f2e829f 100644 --- a/server-node/src/app.ts +++ b/server-node/src/app.ts @@ -5,6 +5,7 @@ import express from 'express'; import bookRouter from './routers/books.router'; import cartItemRouter from './routers/cartItems.router'; import categoryRouter from './routers/category.router'; +import healthCheckRouter from './routers/healthCheck.router'; import likeRouter from './routers/like.router'; import orderRouter from './routers/order.router'; import userRouter from './routers/users.router'; @@ -26,6 +27,7 @@ app.use(categoryRouter); app.use(likeRouter); app.use(cartItemRouter); app.use(orderRouter); +app.use(healthCheckRouter); app.get('/', async (req, res) => { res.send('Hello World'); diff --git a/server-node/src/routers/healthCheck.router.ts b/server-node/src/routers/healthCheck.router.ts new file mode 100644 index 0000000..5128b89 --- /dev/null +++ b/server-node/src/routers/healthCheck.router.ts @@ -0,0 +1,9 @@ +import express from 'express'; + +const router = express.Router(); + +router.get('/healthcheck', (req, res) => { + res.send('OK'); +}); + +export default router;