uptime monitor endpoint

This commit is contained in:
2022-11-24 22:58:27 +01:00
parent 7be72df267
commit f7727c3542
7 changed files with 674 additions and 4 deletions

0
src/service/index.ts Normal file
View File

19
src/service/uptime.ts Normal file
View File

@ -0,0 +1,19 @@
import express from "express";
import pack from "../../package.json";
import startupTime from "../tools/startupTime";
const app = express();
app.get("/", (_req, res) => {
res.status(200).json({
running: true,
version: pack.version,
runningSince: startupTime.toISOString()
});
});
app.all("*", (_req, res) => {
res.status(404).end();
});
app.listen(80);