enable swagger UI in express.js code example
Example: expressjs swagger yaml
// To load your swagger specification yaml file you need to use a module able to convert
// yaml to json; for instance yamljs.
>> npm install --save yamljs
const express = require('express');
const app = express();
const swaggerUi = require('swagger-ui-express');
const YAML = require('yamljs');
const swaggerDocument = YAML.load('./swagger.yaml');
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));