-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.js
More file actions
26 lines (23 loc) · 676 Bytes
/
swagger.js
File metadata and controls
26 lines (23 loc) · 676 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
import swaggerAutogen from "swagger-autogen";
const outputFile = "./swagger-output.json";
const endpointsFiles = ["./src/routes/article.routes.js"];
const doc = {
info: {
title: "Simple JSON API Swagger Boilerplate",
description: "A minimal Node + Express API reading from JSON with Swagger",
},
host: "localhost:8080",
basePath: "/",
schemes: ["http"],
definitions: {
Article: {
title: "Example Article",
description: "This is an example description",
published: false,
},
},
};
swaggerAutogen({ openapi: "3.0.0" })(outputFile, endpointsFiles, doc)
.then(() => {
console.log("Swagger documentation generated!");
});