bdd410672d
Change-Id: Iaa70ed769c7d693ff5172f4fd3204677e4834a8a
28 lines
766 B
JavaScript
28 lines
766 B
JavaScript
const swaggerJSDoc = require('swagger-jsdoc');
|
|
const swaggerUi = require('swagger-ui-express');
|
|
const path = require('path');
|
|
|
|
module.exports = {
|
|
init(self) {
|
|
const swaggerDefinition = {
|
|
openapi: '3.0.0',
|
|
info: {
|
|
title: 'NebulOus API',
|
|
version: '1.0.0',
|
|
description: 'Documentation for NebulOus API',
|
|
}
|
|
};
|
|
|
|
const swaggerOptions = {
|
|
swaggerDefinition,
|
|
apis: [
|
|
path.join(__dirname, 'swagger.yml'),
|
|
'./modules/**/*.js',
|
|
],
|
|
};
|
|
const swaggerSpec = swaggerJSDoc(swaggerOptions);
|
|
|
|
self.apos.app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
|
|
}
|
|
};
|