even cooler now
This commit is contained in:
16
src/index.ts
16
src/index.ts
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user