fix(selfhost): pin MinIO images and add application health checks
This commit is contained in:
@@ -98,10 +98,6 @@ async function main() {
|
||||
done()
|
||||
})
|
||||
|
||||
app.get('/health', async (req, res) => {
|
||||
return res.send({ status: 'ok' })
|
||||
})
|
||||
|
||||
//Plugin nur auf bestimmten Routes
|
||||
await app.register(queryConfigPlugin, {
|
||||
routes: ['/api/resource/:resource/paginated']
|
||||
|
||||
@@ -2,6 +2,16 @@ import { FastifyInstance } from "fastify";
|
||||
import { getBuildInfo } from "../utils/buildInfo";
|
||||
|
||||
export default async function routes(server: FastifyInstance) {
|
||||
server.get("/health", async (_request, reply) => {
|
||||
reply.header("Cache-Control", "no-store");
|
||||
try {
|
||||
await server.db.execute("SELECT 1");
|
||||
return { status: "ok", ...getBuildInfo() };
|
||||
} catch {
|
||||
return reply.code(503).send({ status: "unavailable" });
|
||||
}
|
||||
});
|
||||
|
||||
server.get("/version", async (_request, reply) => {
|
||||
reply.header("Cache-Control", "no-store");
|
||||
return getBuildInfo();
|
||||
|
||||
Reference in New Issue
Block a user