Generic Commit; Most likely a fix or small feature
This commit is contained in:
11
src/index.ts
11
src/index.ts
@@ -1,4 +1,6 @@
|
||||
import { logInfo } from "@dpu/shared/dist/logger.js";
|
||||
import fastifySwagger from "@fastify/swagger";
|
||||
import fastifySwaggerUi from "@fastify/swagger-ui";
|
||||
import type { FastifyReply, FastifyRequest } from "fastify";
|
||||
import Fastify from "fastify";
|
||||
import fastifyAxios from "fastify-axios";
|
||||
@@ -7,7 +9,7 @@ import {
|
||||
validatorCompiler,
|
||||
type ZodTypeProvider,
|
||||
} from "fastify-type-provider-zod";
|
||||
import z from "zod";
|
||||
import { z } from "zod";
|
||||
import { Config } from "./config.js";
|
||||
import { HomeAssistantClient } from "./homeassistant/client.js";
|
||||
import { homeAssistantRoutes } from "./homeassistant/routes.js";
|
||||
@@ -21,7 +23,7 @@ const fastify = Fastify().withTypeProvider<ZodTypeProvider>();
|
||||
fastify.setValidatorCompiler(validatorCompiler);
|
||||
fastify.setSerializerCompiler(serializerCompiler);
|
||||
|
||||
await fastify.register(require("@fastify/swagger"), {
|
||||
await fastify.register(fastifySwagger, {
|
||||
openapi: {
|
||||
info: {
|
||||
title: "DPU API",
|
||||
@@ -30,12 +32,9 @@ await fastify.register(require("@fastify/swagger"), {
|
||||
},
|
||||
servers: [{ url: "http://localhost:8080", description: "Development" }],
|
||||
},
|
||||
transform: ({ schema, url }: { schema: unknown; url: string }) => {
|
||||
return { schema, url };
|
||||
},
|
||||
});
|
||||
|
||||
await fastify.register(require("@fastify/swagger-ui"), {
|
||||
await fastify.register(fastifySwaggerUi, {
|
||||
routePrefix: "/docs",
|
||||
uiConfig: {
|
||||
docExpansion: "list",
|
||||
|
||||
Reference in New Issue
Block a user