parent
b382f0689b
commit
4e5e08483d
@ -10,6 +10,8 @@ const PORT = process.env.APP_PORT || 4010;
|
|||||||
const app = createExpressServer({
|
const app = createExpressServer({
|
||||||
controllers: [__dirname + "/controllers/*.ts"],
|
controllers: [__dirname + "/controllers/*.ts"],
|
||||||
development: process.env.NODE_ENV === "production",
|
development: process.env.NODE_ENV === "production",
|
||||||
|
routePrefix: "/api",
|
||||||
|
controllers: [__dirname + "/controllers/*.ts"],
|
||||||
});
|
});
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
@ -11,7 +11,9 @@ export default async (app: Application) => {
|
|||||||
});
|
});
|
||||||
const spec = routingControllersToSpec(
|
const spec = routingControllersToSpec(
|
||||||
storage,
|
storage,
|
||||||
{},
|
{
|
||||||
|
routePrefix: "/api"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
components: {
|
components: {
|
||||||
schemas,
|
schemas,
|
||||||
@ -27,11 +29,11 @@ export default async (app: Application) => {
|
|||||||
explorer: true,
|
explorer: true,
|
||||||
};
|
};
|
||||||
app.use(
|
app.use(
|
||||||
"/docs",
|
"/api/docs",
|
||||||
swaggerUiExpress.serve,
|
swaggerUiExpress.serve,
|
||||||
swaggerUiExpress.setup(spec, options)
|
swaggerUiExpress.setup(spec, options)
|
||||||
);
|
);
|
||||||
app.get(["/openapi.json", "/swagger.json"], (req, res) => {
|
app.get(["/api/openapi.json", "/api/swagger.json"], (req, res) => {
|
||||||
res.json(spec);
|
res.json(spec);
|
||||||
});
|
});
|
||||||
return app;
|
return app;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user