This commit is contained in:
2024-11-30 13:24:46 +07:00
commit 3e32e5869e
30 changed files with 1196 additions and 0 deletions

17
src/swagger/builder.js Normal file
View File

@ -0,0 +1,17 @@
const swaggerAutogen = require('swagger-autogen')();
const config = require('config');
const doc = {
info: {
title: config.get('app.name'),
description: config.get('app.description'),
version: config.get('app.version')
},
host: config.get('server.host_swagger') + ':' + config.get('server.port'),
};
const outputFile = './swagger.json';
const routes = ['../routes/private.ts', '../routes/public.ts'];
swaggerAutogen(outputFile, routes, doc);