feat: add healthcheck endpoint

This commit is contained in:
mrjvs
2026-09-01 20:54:37 +02:00
parent ba245c0f93
commit a622772eed
2 changed files with 12 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ import morgan from 'morgan';
import xmlbuilder from 'xmlbuilder';
import xmlparser from '@/middleware/xml-parser';
import { connect as connectCache } from '@/cache';
import { checkMarkedDeletions, connect as connectDatabase } from '@/database';
import { connect as connectDatabase } from '@/database';
import { startGRPCServer } from '@/services/grpc/server';
import { fullUrl, getValueFromHeaders, setupScheduledTasks } from '@/util';
import { LOG_INFO, LOG_SUCCESS, LOG_WARN } from '@/logger';
@@ -15,6 +15,7 @@ import datastore from '@/services/datastore';
import api from '@/services/api';
import localcdn from '@/services/local-cdn';
import assets from '@/services/assets';
import healthz from '@/services/healthz';
import { config, disabledFeatures } from '@/config-manager';
import { startProvisioner } from '@/provisioning';
@@ -51,6 +52,7 @@ app.use(nasc);
app.use(api);
app.use(localcdn);
app.use(assets);
app.use(healthz);
if (!disabledFeatures.datastore) {
app.use(datastore);

9
src/services/healthz.ts Normal file
View File

@@ -0,0 +1,9 @@
import express from 'express';
const router = express.Router();
router.get('/healthz', (req, res) => {
res.status(200).send('OK');
});
export default router;