~jae/neos-metrics-exporter

1cc51b2bcca1729a67871f5d0dddd6d6b9b9aec5 — Jae Salokettu (J4) 1 year, 1 month ago 1b73aa1
mainRoute: correct metrics path
1 files changed, 5 insertions(+), 1 deletions(-)

M src/routes/mainRoute.ts
M src/routes/mainRoute.ts => src/routes/mainRoute.ts +5 -1
@@ 3,7 3,11 @@ import { generatePrometheusString } from "../utils/neosApiClient";

const plugin: FastifyPluginCallback = function (fastify, opts, next): void {

    fastify.get("/", async (_request,reply) => {
    fastify.get('/', (_request, reply) => {
        reply.redirect(301, '/metrics');
    });

    fastify.get("/metrics", async (_request,reply) => {
        await reply.send(await generatePrometheusString());
    });