gui-controller/modules/swagger/index.js
jmarchel bdd410672d Adding dockerfile
Change-Id: Iaa70ed769c7d693ff5172f4fd3204677e4834a8a
2024-02-26 21:50:27 +02:00

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));
}
};