Fix Swagger UI configuration and server URLs
Browse files
cruciqe-id-card-backend/src/config/swagger.ts
CHANGED
|
@@ -12,8 +12,8 @@ const swaggerDefinition = {
|
|
| 12 |
},
|
| 13 |
servers: [
|
| 14 |
{
|
| 15 |
-
url: process.env.API_URL || 'http://localhost:
|
| 16 |
-
description: '
|
| 17 |
},
|
| 18 |
],
|
| 19 |
components: {
|
|
@@ -225,7 +225,12 @@ const swaggerDefinition = {
|
|
| 225 |
|
| 226 |
const options = {
|
| 227 |
definition: swaggerDefinition,
|
| 228 |
-
apis: [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
}
|
| 230 |
|
| 231 |
export const swaggerSpec = swaggerJsdoc(options)
|
|
|
|
| 12 |
},
|
| 13 |
servers: [
|
| 14 |
{
|
| 15 |
+
url: process.env.API_URL || (process.env.SPACE_URL ? `https://${process.env.SPACE_URL}` : 'http://localhost:7860'),
|
| 16 |
+
description: 'API Server',
|
| 17 |
},
|
| 18 |
],
|
| 19 |
components: {
|
|
|
|
| 225 |
|
| 226 |
const options = {
|
| 227 |
definition: swaggerDefinition,
|
| 228 |
+
apis: [
|
| 229 |
+
'./src/index.ts',
|
| 230 |
+
'./src/controllers/*.ts',
|
| 231 |
+
'./dist/index.js',
|
| 232 |
+
'./dist/controllers/*.js'
|
| 233 |
+
],
|
| 234 |
}
|
| 235 |
|
| 236 |
export const swaggerSpec = swaggerJsdoc(options)
|