-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.js
31 lines (28 loc) · 882 Bytes
/
swagger.js
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
const swaggerAutogen = require('swagger-autogen')({ openapi: "3.0.0" })
const doc = {
info: {
title: 'Dress Code',
description: 'Dess code application api documentation'
},
servers: [
{
url: 'http://localhost:4000/api',
description: 'Local url'
},
{
url: "https://ecom-be-oeik.onrender.com/api",
description: "This is server url"
}
],
securityDefinitions: {
apiKeyAuth: {
type: 'apiKey',
in: 'header', // can be 'header', 'query' or 'cookie'
name: 'authorization', // name of the header, query parameter or cookie
description: 'Some description...'
}
}
};
const outputFile = './swagger_output.json'
const endpointsFiles = ['./src/routes/index.js']
swaggerAutogen(outputFile, endpointsFiles, doc)