Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1x 1x 26x 26x 26x 26x 26x | import type { FastifyPluginAsync } from "fastify";
import type { AppConfig } from "../config.js";
import { proxyJsonRequest } from "../lib/http-client.js";
/** Публичная статистика каталога (открытые данные) — без авторизации. */
export const statsRoutes: FastifyPluginAsync<{ config: AppConfig }> = async (app, opts) => {
const { config } = opts;
const svc = { "x-service-token": config.serviceToken };
app.get("/stats", async () =>
proxyJsonRequest<unknown>({
method: "GET",
url: `${config.catalogServiceUrl}/stats`,
headers: svc,
timeoutMs: config.upstreamTimeoutMs,
}),
);
};
|