From 9b2ea8c23c09621e5a84dbc013137ea150a4a2dc Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 26 Nov 2020 14:02:51 +0100 Subject: [PATCH] Now also serving the openapi ref #5 --- src/loaders/openapi.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/loaders/openapi.ts b/src/loaders/openapi.ts index 7c47469..963360e 100644 --- a/src/loaders/openapi.ts +++ b/src/loaders/openapi.ts @@ -17,12 +17,22 @@ export default async (app: Application) => { schemas, }, info: { - description: "LfK! Backend API`", + description: "The the backend API for the LfK! runner system.", title: "LfK! Backend API", version: "1.0.0", }, } ); - app.use("/docs", swaggerUiExpress.serve, swaggerUiExpress.setup(spec)); + const options = { + explorer: true, + }; + app.use( + "/docs", + swaggerUiExpress.serve, + swaggerUiExpress.setup(spec, options) + ); + app.get(["/openapi.json", "/swagger.json"], (req, res) => { + res.json(spec); + }); return app; };