Patch 0.0.2 #9

Merged
niggl merged 69 commits from dev into main 2021-02-03 17:24:35 +00:00
Showing only changes of commit 4efb62921b - Show all commits

View File

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