logInfo => logError
This commit is contained in:
12
src/index.ts
12
src/index.ts
@@ -1,5 +1,5 @@
|
||||
import { WsService } from "@dpu/shared";
|
||||
import { logInfo } from "@dpu/shared/dist/logger.js";
|
||||
import { logError } from "@dpu/shared/dist/logger.js";
|
||||
import fastifyCors from "@fastify/cors";
|
||||
import fastifySwagger from "@fastify/swagger";
|
||||
import fastifySwaggerUi from "@fastify/swagger-ui";
|
||||
@@ -8,10 +8,10 @@ import type { FastifyReply, FastifyRequest } from "fastify";
|
||||
import Fastify from "fastify";
|
||||
import fastifyAxios from "fastify-axios";
|
||||
import {
|
||||
jsonSchemaTransform,
|
||||
serializerCompiler,
|
||||
validatorCompiler,
|
||||
type ZodTypeProvider,
|
||||
jsonSchemaTransform,
|
||||
serializerCompiler,
|
||||
validatorCompiler,
|
||||
type ZodTypeProvider,
|
||||
} from "fastify-type-provider-zod";
|
||||
import { SwaggerTheme, SwaggerThemeNameEnum } from "swagger-themes";
|
||||
import { z } from "zod";
|
||||
@@ -117,7 +117,7 @@ async function verifyAPIKey(
|
||||
const apiKey = request.headers["x-api-key"];
|
||||
|
||||
if (!apiKey || apiKey !== Config.api_key) {
|
||||
logInfo("POST Request with wrong API key received");
|
||||
logError("POST Request with wrong API key received");
|
||||
return reply.code(401).send({ error: "Invalid API key" });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user