doc: add title, version, description to swagger

This commit is contained in:
Artemy 2023-08-16 12:15:51 +03:00
parent b0bbcd0bba
commit af2c964e4d
2 changed files with 16 additions and 1 deletions

View File

@ -15,6 +15,8 @@ import parseRoute from "./routes/parse";
import indexRoute from "./routes/index";
import rawHtml from "./routes/raw-html";
import publicConfig from "./publicConfig";
class App {
config: IConfigService;
@ -38,7 +40,15 @@ class App {
},
});
await fastify.register(fastifySwagger);
await fastify.register(fastifySwagger, {
swagger: {
info: {
title: "TXTDot API",
description: publicConfig.description,
version: publicConfig.version,
},
},
});
await fastify.register(fastifySwaggerUi, { routePrefix: "/doc" });
fastify.register(indexRoute);

5
src/publicConfig.ts Normal file
View File

@ -0,0 +1,5 @@
export default {
version: "1.0.0",
description:
"HTTP proxy that parses only text, links and pictures from pages reducing internet traffic, removing ads and heavy scripts",
};