From af2c964e4dc6a0ccb13c5a024d2935c9c6ad94c8 Mon Sep 17 00:00:00 2001 From: Artemy Date: Wed, 16 Aug 2023 12:15:51 +0300 Subject: [PATCH] doc: add title, version, description to swagger --- src/app.ts | 12 +++++++++++- src/publicConfig.ts | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/publicConfig.ts diff --git a/src/app.ts b/src/app.ts index 0fab5e0..2d9ea54 100644 --- a/src/app.ts +++ b/src/app.ts @@ -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); diff --git a/src/publicConfig.ts b/src/publicConfig.ts new file mode 100644 index 0000000..57a09c7 --- /dev/null +++ b/src/publicConfig.ts @@ -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", +};