Swagger UI Restify
Adds middleware to your restify app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
Swagger version is pulled from npm module swagger-ui-dist. Please use a lock file or specify the version of swagger-ui-dist you want to ensure it is consistent across environments.
Usage
Install using npm:
$ npm install --save swagger-ui-restify
Restify setup app.js
const restify = ;const app = restify;const swaggerUi = ;const swaggerDocument = ; // options are optional; see below.// If your swagger doc is in yaml, not json, you can convert it with yamljs.const options = {};const serveSwagger = ; app;app;
Open http://<app_host>
:<app_port>
/api-docs in your browser to view the documentation.
Supported options
``` ## Requirements - Node v10 or above- Restify 5 or above ## Testing - Install phantom- `npm install`- `npm test`