even cooler now

This commit is contained in:
Darius
2026-02-09 20:02:47 +01:00
parent ff66061c32
commit c98304fe8e
6 changed files with 80 additions and 116 deletions

View File

@@ -3,17 +3,17 @@ import { logError } from "@dpu/shared/dist/logger.js";
import fastifyCors, { type FastifyCorsOptions } from "@fastify/cors";
import fastifySwagger, { type SwaggerOptions } from "@fastify/swagger";
import fastifySwaggerUi, {
type FastifySwaggerUiOptions,
type FastifySwaggerUiOptions,
} from "@fastify/swagger-ui";
import fastifyWebsocket from "@fastify/websocket";
import type { FastifyReply, FastifyRequest } from "fastify";
import Fastify from "fastify";
import fastifyAxios, { type FastifyAxiosOptions } from "fastify-axios";
import {
jsonSchemaTransform,
serializerCompiler,
validatorCompiler,
type ZodTypeProvider,
jsonSchemaTransform,
serializerCompiler,
validatorCompiler,
type ZodTypeProvider,
} from "fastify-type-provider-zod";
import type { OpenAPIV3 } from "openapi-types";
import { SwaggerTheme, SwaggerThemeNameEnum } from "swagger-themes";
@@ -26,7 +26,6 @@ import { HomeAssistantClient } from "./homeassistant/client.js";
import { privateHomeAssistantRoutes } from "./homeassistant/private-routes.js";
import { HomeAssistantService } from "./homeassistant/service.js";
import { privateHomepageRoutes } from "./homepage/private-routes.js";
import { publicHomepageRoutes } from "./homepage/public-routes.js";
import { HomepageService } from "./homepage/service.js";
import { TidalClient } from "./tidal/client.js";
import { privateTidalRoutes } from "./tidal/private-routes.js";
@@ -168,10 +167,7 @@ async function verifyAPIKey(
}
// Register routes
await publicServer.register(publicWsRoutes, { wsService });
await publicServer.register(publicHomepageRoutes, {
hpService,
});
await publicServer.register(publicWsRoutes, { wsService, hpService });
await privateServer.register(privateGristRoutes, { gristService });
await privateServer.register(privateHomeAssistantRoutes, {