-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.js
40 lines (37 loc) · 1.06 KB
/
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
32
33
34
35
36
37
38
39
40
const swaggerAutogen = require('swagger-autogen')()
const outputFile = './swagger_output.json'
const endpointsFiles = ['./endpoints.js']
const doc = {
info: {
version: "1.0.0",
title: "Crypto Coin Easy API",
description: "Documentation automatically generated by the <b>swagger-autogen</b> module."
},
host: "localhost:3000",
basePath: "/",
schemes: ['http', 'https'],
consumes: ['application/json'],
produces: ['application/json'],
tags: [
{
"name": "GET",
"description": "Endpoint to get the informations about some coin."
}
],
definitions: {
Response: {
"succeed": true,
"status": 200,
"message": "OK",
"update": 1638295465671,
"content": {
"name": "CryptoMines Eternal",
"symbol": "ETERNAL",
"price": "291.980736788007684237953066731"
}
}
}
}
swaggerAutogen(outputFile, endpointsFiles, doc).then(() => {
require('./index.js')
})