5.3.0 • Published 3 years ago
volante-swagger v5.3.0
Volante Swagger Spoke
Volante module for Swagger/OpenAPI doc parsing and browsing through a live Swagger UI served through volante-express.
Usage
npm install volante-swaggerVolante modules are automatically loaded and instanced if they are installed locally and hub.attachAll() is called. Or add it to the "attach" array in your volante config file.
{
"attach": [
"volante-swagger"
]
}Once the Volante-powered server is running (for example, with volante-express defaults), the Swagger UI should be accessible at:
http://localhost:3000/api/swagger
Props
Options are changed using either the config file VolanteSwagger sub-object:
{
"VolanteSwagger": {
"enabled": true,
"title": "Cool server",
"description": "a description",
"ui": "<defaults to /api/swagger>",
"json": "<defaults to /api/swagger.json>"
}
}...or manually via a VolanteSwagger.update event with an options object:
hub.emit('VolanteSwagger.update', {
enabled: true,
title: "Cool server",
description: "a description",
ui: "<defaults to /api/swagger>",
json: "<defaults to /api/swagger.json>"
});Events Emitted
In addition to native Volante log events, this modules also emits:
VolanteSwagger.accessed()- emitted when the swagger-ui page is requestedevents: { 'VolanteSwagger.accessed'() { this.$log('swagger ui was accessed'); } }
License
ISC