add health check to root

This commit is contained in:
wphan
2023-06-29 13:34:10 -07:00
parent f0f47c7446
commit 537bc2902a

View File

@@ -374,8 +374,7 @@ const main = async () => {
bulkAccountLoader bulkAccountLoader
); );
// start http server listening to /health endpoint using http package const handleHealthCheck = async (req, res, next) => {
app.get('/health', handleResponseTime, async (req, res, next) => {
try { try {
if (req.url === '/health') { if (req.url === '/health') {
if (opts.testLiveness) { if (opts.testLiveness) {
@@ -451,7 +450,11 @@ const main = async () => {
} catch (e) { } catch (e) {
next(e); next(e);
} }
}); };
// start http server listening to /health endpoint using http package
app.get('/health', handleResponseTime, handleHealthCheck);
app.get('/', handleResponseTime, handleHealthCheck);
app.get('/orders/json/raw', handleResponseTime, async (_req, res, next) => { app.get('/orders/json/raw', handleResponseTime, async (_req, res, next) => {
try { try {