Created
December 19, 2017 06:09
-
-
Save rajiff/1a901fb12a1de72df50d95abfac11cc3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 express = require('express'); | |
const swaggerUI = require('swagger-ui-express'); | |
const YAML = require('yamljs'); | |
const swaggerDocument = YAML.load('./api/swagger/swagger.yaml'); | |
let app = express(); | |
// Mount the SwaggerUI Middleware, at your preferred mount path | |
let swaggerOptions = { explorer: false }; | |
app.use('/api/v1/docs', | |
swaggerUI.serve, | |
swaggerUI.setup(swaggerDocument, swaggerOptions) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment