Skip to content

Commit

Permalink
Add health monitoring route
Browse files Browse the repository at this point in the history
  • Loading branch information
raghav-rama committed Dec 7, 2024
1 parent 837c00f commit b23a8a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import express from 'express';
import cors from 'cors';
import Config from './config.js';
import router from './routes/mintOptions.route.js';
import healthRouter from './routes/health.route.js';
import Honeybadger from '@honeybadger-io/js';

const app = express();
Expand Down Expand Up @@ -36,6 +37,7 @@ try {
next();
});
app.use('/mint-options', router);
app.use('/health', healthRouter);
} catch (error) {
console.error('Error connecting to database: ', error);
} finally {
Expand Down
9 changes: 9 additions & 0 deletions src/routes/health.route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Router } from 'express';

const router = Router();

router.get('/', (_req, res) => {
res.status(200).json({ message: 'OK' });
});

export default router;

0 comments on commit b23a8a3

Please sign in to comment.