swagger-editor-binder

1.0.4 • Public • Published

swagger-editor-binder

npm version

Binds the swagger editor to an express (or restify) route

Installation

npm i swagger-editor-binder

Usage

With express

var express = require('express');
var swaggerEditorBinder = require('swagger-editor-binder');
var path = require('path');
 
var app = express();
 
swaggerEditorBinder.express({
  server: app,
  path: '/edit',
  file: path.resolve(__dirname, 'swagger.yaml')
});
 
app.listen(3000, function () {
  console.log('Swagger editor @ http://localhost:3000/edit/');
});

With restify

var restify = require('restify');
var path = require('path');
var swaggerEditorBinder = require('swagger-editor-binder');
 
var app = restify.createServer();
 
swaggerEditorBinder.restify({
  server: app,
  path: '/edit',
  file: path.resolve(__dirname, 'swagger.yaml')
});
 
app.listen(3000, function() {
  console.log('Swagger editor @ http://localhost:3000/edit/');
});

Package Sidebar

Install

npm i swagger-editor-binder

Weekly Downloads

1

Version

1.0.4

License

MIT

Last publish

Collaborators

  • rundef