File size: 820 Bytes
d8ce00b
e6d05c3
d8ce00b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9858daf
 
 
 
 
 
 
 
 
 
 
 
 
 
d8ce00b
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import swaggerJSDoc, { Options } from "swagger-jsdoc";
import { APP_CONFIG } from "../config/app.config";

const swaggerOptions: Options = {
  swaggerDefinition: {
    openapi: "3.0.0",
    info: {
      title: "FusionBills Express API",
      version: "1.0.0",
      description: "FusionBills Express API Swagger",
    },
    servers: [
      {
        url: APP_CONFIG.appURL,
        description: "API documentation",
      },
    ],
    schemes: ["http", "https"],
    basePath: "/",
    components: {
      securitySchemes: {
        bearerAuth: {
          type: "http",
          scheme: "bearer",
          bearerFormat: "JWT",
        },
      },
    },
    security: [
      {
        bearerAuth: [],
      },
    ],
  },
  apis: ["**/*.routes.ts"],
};

export const swaggerDocs = swaggerJSDoc(swaggerOptions);