Last active
February 9, 2021 11:03
-
-
Save azizkale/94928aa83cdedd4cb910a387ab040951 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { | |
definition: { | |
openapi: "3.0.0", | |
info: { | |
title: "Library API", | |
version: "1.0.0", | |
description: "A simple Express Library API", | |
termsOfService: "http://example.com/terms/", | |
contact: { | |
name: "API Support", | |
url: "http://www.exmaple.com/support", | |
email: "[email protected]", | |
}, | |
}, | |
servers: [ | |
{ | |
url: "http://localhost:4001", | |
description: "My API Documentation", | |
}, | |
], | |
}, | |
apis: ["./Routes/*.js"], | |
}; | |
const specs = swaggerJsDoc(options); | |
app.use("/api-docs", swaggerUI.serve, swaggerUI.setup(specs)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment