-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.ts
52 lines (48 loc) · 1022 Bytes
/
swagger.ts
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
import swaggerJSDoc from 'swagger-jsdoc'
const swaggerDefinition = {
openapi: '3.0.0',
info: {
title: 'Gen AI API',
version: '1.0.0',
description:
'This is an Express service that provides authorization functionality and includes gen-AI features using RAG, Redis, Postgres, and Langchain.',
},
servers: [
{
url: 'http:localhost:3000',
},
],
tags: [
{
name: 'Auth',
description: 'Endpoints related to authentication',
},
{
name: 'Users',
description: 'Endpoints related to users management',
},
{
name: 'AI',
description: 'Endpoints related to gen-ai features',
},
{
name: 'Resources',
description: 'Endpoints related to resources for gen-ai features',
},
],
components: {
securitySchemes: {
bearerAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
},
},
},
}
const options = {
swaggerDefinition,
apis: ['./src/modules/**/application/routes/*.ts'],
}
const swaggerSpec = swaggerJSDoc(options)
export default swaggerSpec