issue # spring -> fastify 이전 중
This commit is contained in:
33
src/utils/plugin/swagger.ts
Normal file
33
src/utils/plugin/swagger.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { FastifyInstance } from "fastify";
|
||||
import fastifySwagger from "@fastify/swagger";
|
||||
import fastifySwaggerUi from "@fastify/swagger-ui";
|
||||
|
||||
export async function registerSwagger(fastify: FastifyInstance) {
|
||||
await fastify.register(fastifySwagger, {
|
||||
openapi: {
|
||||
info: {
|
||||
title: "API Docs",
|
||||
description: "API documentation for Fastify server",
|
||||
version: "1.0.0"
|
||||
},
|
||||
servers: [
|
||||
{
|
||||
url: "http://localhost:3000",
|
||||
description: "Local Development",
|
||||
},
|
||||
{
|
||||
url: "https://api.scheduler.bkdhome.p-e.kr",
|
||||
description: "Production Server"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
await fastify.register(fastifySwaggerUi, {
|
||||
routePrefix: "/docs",
|
||||
uiConfig: {
|
||||
docExpansion: "none",
|
||||
deepLinking: false
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user