Now also serving the openapi

ref #5
This commit is contained in:
Nicolai Ort 2020-11-26 14:02:51 +01:00
parent 51ff9defc5
commit 9b2ea8c23c
1 changed files with 12 additions and 2 deletions

View File

@ -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;
};