-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.js
42 lines (39 loc) · 942 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
32
33
34
35
36
37
38
39
40
41
42
const swaggerAutogen = require('swagger-autogen')();
const doc = {
info: {
title: 'Blog-api',
description: 'An API of my personal blog application.'
},
host: 'localhost:5050',
basePath: "",
schemes: ['http'],
consumes: ['application/json'],
produces: ['application/json'],
tags: [
{
name: "User",
description: "Endpoints"
},
{
name: "Admin",
description: "Endpoints"
},
{
name: "Articles",
description: "Endpoints"
},
{
name: "Tags",
description: "Endpoints"
},
{
name: "Comments",
description: "Endpoints"
}
],
securityDefinitions: {},
definitions: {}
};
const outputFile = "./swagger-output.json";
const endPointsFile = ["./app.js"];
swaggerAutogen(outputFile, endPointsFile, doc);