add version on footer

This commit is contained in:
2025-03-29 15:32:34 +01:00
parent d5b18295c0
commit 12bb9a157e
5 changed files with 45 additions and 1 deletions

View File

@@ -611,6 +611,14 @@ app.get('/api/lookup', async (req, res) => {
}
});
// Version Endpunkt
app.get('/api/version', (req, res) => {
const commitSha = process.env.GIT_COMMIT_SHA || 'unknown';
logger.info({ commitSha }, 'Version request received');
res.json({ commitSha });
});
// --- Server starten ---
initialize().then(() => {
app.listen(PORT, () => {
@@ -620,6 +628,7 @@ initialize().then(() => {
logger.info(` http://localhost:${PORT}/api/ping?targetIp=<ip>`);
logger.info(` http://localhost:${PORT}/api/traceroute?targetIp=<ip>`);
logger.info(` http://localhost:${PORT}/api/lookup?targetIp=<ip>`);
logger.info(` http://localhost:${PORT}/api/version`);
});
}).catch(error => {
// Fehler bei der Initialisierung wurde bereits geloggt.