Skip to content

Commit e69dfb2

Browse files
author
hirsch88
committed
Add env routes to the swagger doc
1 parent 5232f8f commit e69dfb2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/api/swagger.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"swagger": "2.0",
3-
"host": "localhost:3000",
3+
"host": "",
44
"info": {
55
"title": "",
66
"description": "",
77
"version": ""
88
},
9-
"basePath": "/api",
9+
"basePath": "",
1010
"consumes": [
1111
"application/json"
1212
],

src/loaders/swaggerLoader.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export const swaggerLoader: MicroframeworkLoader = (settings: MicroframeworkSett
1616
description: env.app.description,
1717
version: env.app.version,
1818
};
19+
swaggerFile.host = env.app.route;
20+
swaggerFile.basePath = env.app.routePrefix;
1921

2022
expressApp.use(
2123
env.swagger.route,

0 commit comments

Comments
 (0)