-
Notifications
You must be signed in to change notification settings - Fork 337
/
swagger.js
31 lines (27 loc) · 889 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')()
const config = require('./config');
const doc = {
info: {
version: "4.0.0",
title: "API do WhatsApp API REST",
description: "Permite a integração do WhatsApp com qualquer aplicação por meio de requisições POST/GET\n"
},
host: config?.host_ssl ?? '',
basePath: "/",
schemes: ['https'],
consumes: ['application/json'],
produces: ['application/json'],
securityDefinitions: {
apitoken: {
type: "apiKey",
in: "header", // can be "header", "query" or "cookie"
name: "X-API-KEY", // name of the header, query parameter or cookie
description: "Token de Autenticação da API..."
}
}
}
const outputFile = './swagger_output.json'
const endpointsFiles = ['./routers/WppConnect.js']
swaggerAutogen(outputFile, endpointsFiles, doc).then(() => {
require('./index.js')
})