Added openapi viewers

ref #6
This commit is contained in:
2021-02-02 14:31:09 +01:00
parent d493e74bf3
commit 6435c8a88e
10 changed files with 9471 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import { validationMetadatasToSchemas } from "@odit/class-validator-jsonschema";
import { Application } from "express";
import express, { Application } from "express";
import path from 'path';
import { getMetadataArgsStorage } from "routing-controllers";
import { generateSpec } from '../apispec';
@@ -18,6 +19,6 @@ export default async (app: Application) => {
app.get(["/docs/openapi.json", "/docs/swagger.json"], (req, res) => {
res.json(spec);
});
//app.use('/api/docs', express.static(path.join(__dirname, '../static/docs'), { index: "index.html", extensions: ['html'] }));
app.use('/docs', express.static(path.join(__dirname, '../static/docs'), { index: "index.html", extensions: ['html'] }));
return app;
};