代理后端出版
This commit is contained in:
41
swagger.js
Normal file
41
swagger.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const swaggerJsdoc = require('swagger-jsdoc');
|
||||
|
||||
// Swagger定义
|
||||
const options = {
|
||||
definition: {
|
||||
openapi: '3.0.0',
|
||||
info: {
|
||||
title: '炬融圈代理后台',
|
||||
version: '1.0.0',
|
||||
description: '炬融圈代理后台API文档',
|
||||
contact: {
|
||||
name: '技术支持',
|
||||
email: 'support@example.com'
|
||||
},
|
||||
},
|
||||
servers: [
|
||||
{
|
||||
url: '/api',
|
||||
description: 'API服务器'
|
||||
}
|
||||
],
|
||||
components: {
|
||||
securitySchemes: {
|
||||
bearerAuth: {
|
||||
type: 'http',
|
||||
scheme: 'bearer',
|
||||
bearerFormat: 'JWT'
|
||||
}
|
||||
}
|
||||
},
|
||||
security: [{
|
||||
bearerAuth: []
|
||||
}]
|
||||
},
|
||||
// API文档扫描路径
|
||||
apis: ['./docs/schemas/*.js', './docs/apis/*.js', './routes/*.js'],
|
||||
};
|
||||
|
||||
const specs = swaggerJsdoc(options);
|
||||
|
||||
module.exports = specs;
|
||||
Reference in New Issue
Block a user