doc: add title, version, description to swagger
This commit is contained in:
parent
b0bbcd0bba
commit
af2c964e4d
12
src/app.ts
12
src/app.ts
@ -15,6 +15,8 @@ import parseRoute from "./routes/parse";
|
|||||||
import indexRoute from "./routes/index";
|
import indexRoute from "./routes/index";
|
||||||
import rawHtml from "./routes/raw-html";
|
import rawHtml from "./routes/raw-html";
|
||||||
|
|
||||||
|
import publicConfig from "./publicConfig";
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
config: IConfigService;
|
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" });
|
await fastify.register(fastifySwaggerUi, { routePrefix: "/doc" });
|
||||||
|
|
||||||
fastify.register(indexRoute);
|
fastify.register(indexRoute);
|
||||||
|
5
src/publicConfig.ts
Normal file
5
src/publicConfig.ts
Normal 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",
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user