-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswaggerAutogen.js
More file actions
36 lines (31 loc) · 968 Bytes
/
swaggerAutogen.js
File metadata and controls
36 lines (31 loc) · 968 Bytes
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
"use strict"
const HOST = "https://task-manager-api-virid.vercel.app"
const swaggerAutogen = require('swagger-autogen')()
const packageJson = require('./package.json')
const document = {
info: {
version: packageJson.version,
title: packageJson.title,
description: packageJson.description,
termsOfService: "https://furkandogu.vercel.app",
contact: { name: packageJson.author, email: "furkandogu2018@gmail.com" },
license: { name: packageJson.license, },
},
host: `${HOST}`,
basePath: '/',
schemes: ['https'],
consumes: ["application/json"],
produces: ["application/json"],
securityDefinitions: {
bearerAuth: {
type: "http",
scheme: "bearer",
bearerFormat: "JWT",
description: "JWT Authorization header using the Bearer scheme. Example: <b>Bearer yourTokenHere</b>"
}
},
security: [{ bearerAuth: [] }]
};
const routes = ['./index.js']
const outputFile = './src/configs/swagger.json'
swaggerAutogen(outputFile, routes, document)