This is an example how to setup swagger docs api endpoint for your koa app.
const Koa = require('koa');
const path = require('path');
const http = require('http');
const swagger = require('./swagger');
const app = new Koa();
const server = http.createServer(app.callback());
swagger(app, {
title: 'The Service',
version: '1.0.0',
apiUrl: 'https://github.com/api',
parseOnRequest: process.env.NODE_ENV !== 'production',
apis: [
path.join(process.cwd(), '/src/actions/**/*.js'),
path.join(process.cwd(), '/src/models/**/*.js'),
],
securityDefinitions: {
jwt: {
description: 'Api auth token',
type: 'apiKey',
name: 'Authorization',
in: 'header',
},
},
});
server.listen(3000, () => {
console.log(`Server is listening on http://0.0.0.0:3000`);
});
did you find the document about this ?