add health check to root
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user