@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user