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": "", 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;