Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const swaggerOptions = {
swaggerDefinition: {
info: {
title: "Documenting REST API's",
description: "This is an implementation of how to document your RESTful API's using SWAGGER",
servers: ['http://localhost:3000']
"components": {
"schemas": {
"fruits": {
"properties": {
"name": {
"type": "string"
apis: ['./routes/api/fruits.js']
const swaggerDocs = swaggerJsonDoc(swaggerOptions)
app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(swaggerDocs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment