Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Latest commit

 

History

History
35 lines (24 loc) · 1.18 KB

README.md

File metadata and controls

35 lines (24 loc) · 1.18 KB

Build Status

swaggerize-restify

swaggerize-restify is a fork of excellent swaggerize-express, with some fixes to work with Restify.

Quick Start

The quickest way to get up and running with swaggerize-restify is to follow swaggerize-express documentation: Quick Start with a Generator. After you have generated new swaggerize-express project, all you need to do is to install swaggerize-restify:

$ npm install swaggerize-restify

And use properly modified server.js file:

var restify = require('restify');
var swaggerize = require('swaggerize-restify');
var path = require('path');

var server = restify.createServer();

server.use(restify.bodyParser());

swaggerize(server, {
    api: path.resolve('./config/petstore.json'),
    handlers: path.resolve('./handlers')
});

server.listen(8000, 'localhost', function () {
    server.swagger.api.host = server.address().address + ':' + server.address().port;
});