Skip to content

Commit

Permalink
Use "swagger" config entry
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkCat09 committed Sep 25, 2023
1 parent 809a389 commit 9ffba00
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ class App {
},
});

await fastify.register(fastifySwagger, {
swagger: {
info: {
title: "TXTDot API",
description: publicConfig.description,
version: publicConfig.version,
},
}
});
await fastify.register(fastifySwaggerUi, { routePrefix: "/doc" });
if (config.swagger) {
await fastify.register(fastifySwagger, {
swagger: {
info: {
title: "TXTDot API",
description: publicConfig.description,
version: publicConfig.version,
},
}
});
await fastify.register(fastifySwaggerUi, { routePrefix: "/doc" });
}

fastify.register(indexRoute);
fastify.register(getRoute);
Expand Down

0 comments on commit 9ffba00

Please sign in to comment.