diff --git a/src/loaders/openapi.ts b/src/loaders/openapi.ts index 26ca18b..f305dfa 100644 --- a/src/loaders/openapi.ts +++ b/src/loaders/openapi.ts @@ -1,6 +1,5 @@ import { validationMetadatasToSchemas } from "@odit/class-validator-jsonschema"; -import express, { Application } from "express"; -import path from 'path'; +import { Application } from "express"; import { getMetadataArgsStorage } from "routing-controllers"; import { generateSpec } from '../apispec'; @@ -16,9 +15,9 @@ export default async (app: Application) => { //Spec creation based on the previously created schemas const spec = generateSpec(storage, schemas); - app.get(["/api/docs/openapi.json", "/api/docs/swagger.json"], (req, res) => { + 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('/api/docs', express.static(path.join(__dirname, '../static/docs'), { index: "index.html", extensions: ['html'] })); return app; };