Skip to content

robzsk/swagger-ui-alone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alone

Serve Swagger interactive UI on the fly and all alone!

Usage

const alone = require('swagger-ui-alone');

// example spec, insert your own here
const spec = {
  swagger: '2.0',
  info: { version: '0.0.1', title: 'Spec Title' },
  paths: { '/foo': { get: { responses: { '200': { description: 'OK' } } } } },
};

// turn your spec into a swagger-ui page
const docs = alone(spec);

// now I can write the docs to a file
require('fs').writeFileSync('index.html', docs);

// or I can http serve the docs
require('http').createServer((request, response) => { response.end(docs); }).listen(8080);

About

Serve your interactive swagger docs using one file, alone!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published