switched over to using the static deployment of swaggerUI

ref #52
This commit is contained in:
2020-12-23 15:20:06 +01:00
parent bd46a48f76
commit 39ad43bbb2
6 changed files with 8969 additions and 11 deletions

View File

@@ -3,7 +3,6 @@ import express, { Application } from "express";
import path from 'path';
import { getMetadataArgsStorage } from "routing-controllers";
import { routingControllersToSpec } from "routing-controllers-openapi";
import * as swaggerUiExpress from "swagger-ui-express";
/**
* Loader for everything openapi related - from creating the schema to serving it via a static route and swaggerUiExpress.
@@ -47,15 +46,15 @@ export default async (app: Application) => {
}
);
//Options for swaggerUiExpress
const options = {
explorer: true,
};
app.use(
"/api/docs/swagger",
swaggerUiExpress.serve,
swaggerUiExpress.setup(spec, options)
);
// //Options for swaggerUiExpress
// const options = {
// explorer: true,
// };
// app.use(
// "/api/docs/swagger",
// swaggerUiExpress.serve,
// swaggerUiExpress.setup(spec, options)
// );
app.get(["/api/docs/openapi.json", "/api/docs/swagger.json"], (req, res) => {
res.json(spec);
});