forked from kubero-dev/kubero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.js
59 lines (56 loc) · 1.43 KB
/
swagger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const swaggerAutogen = require('swagger-autogen')({openapi: '3.0.0'})
// https://github.com/davibaltar/swagger-autogen
const doc = {
info: {
version: '1.10.1',
title: 'Kubero',
description: 'Kubero is a web-based tool deploy applications on a Kubernetes clusters. It provides a simple and intuitive interface to manage your clusters, applications, and pipelines.',
},
host: 'localhost:2000',
basePath: '/api',
schemes: ['http'],
tags: [
{
name: 'Apps',
description: 'Application management',
},
{
name: 'Addons',
description: 'Addons management',
},
{
name: 'Config',
description: 'Configuration management',
},
{
name: 'Pipeline',
description: 'Pipeline management',
},
{
name: 'Settings',
description: 'Settings management',
},
{
name: 'UI',
description: 'UI endpoints - require session',
},
],
securityDefinitions: {
bearerAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
}
}
};
swaggerAutogen('./swagger.json', [
'./dist/routes/addons.js',
'./dist/routes/apps.js',
'./dist/routes/auth.js',
'./dist/routes/config.js',
'./dist/routes/logs.js',
'./dist/routes/pipelines.js',
'./dist/routes/repo.js',
'./dist/routes/settings.js',
'./dist/routes/services.js',
], doc);