[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

aerchen/swaggerui2koa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swaggerui2koa

swagger ui middleware for koa2

install

npm install swaggerui2koa

example

const app = new koa();

// load swagger schema
const spec = fs.readFileSync(path.join(__dirname,'swagger.yaml'), 'utf8');
const swaggerDoc = jsyaml.safeLoad(spec);

const options = {
  swaggerUi: 'swagger' // config swagger ui path
};
// Serve the Swagger documents and Swagger UI
app.use(require('../index')(swaggerDoc, options));
// vist swagger ui view on http://localhost:8080/swagger/

app.listen(8080);

About

swagger ui middleware for koa2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published