Skip to content

Commit e1ac296

Browse files
committed
wip: swagger
1 parent 5c74cbf commit e1ac296

File tree

8 files changed

+1311
-2
lines changed

8 files changed

+1311
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# 1.5.3 (develop)
22

3+
### Feature
4+
5+
* Swagger documentation
6+
37
### Fixed
48

59
* Remove rabbitmq queues when delete instances
610
* Improvement in restart instance to completely redo the connection
11+
* Update node version: v20
712

813
# 1.5.2 (2023-09-28 17:56)
914

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16.18-alpine
1+
FROM node:20.7.0-alpine
22

33
LABEL version="1.5.2" description="Api to control whatsapp features through http requests."
44
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
"sharp": "^0.30.7",
7979
"socket.io": "^4.7.1",
8080
"socks-proxy-agent": "^8.0.1",
81-
"uuid": "^9.0.0"
81+
"swagger-ui-express": "^5.0.0",
82+
"uuid": "^9.0.0",
83+
"yamljs": "^0.3.0"
8284
},
8385
"devDependencies": {
8486
"@types/compression": "^1.7.2",
File renamed without changes.

src/docs/swagger.conf.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Router } from 'express';
2+
import { join } from 'path';
3+
import swaggerUi from 'swagger-ui-express';
4+
import YAML from 'yamljs';
5+
6+
const document = YAML.load(join(process.cwd(), 'src', 'docs', 'swagger.yaml'));
7+
8+
const router = Router();
9+
10+
export const swaggerRouter = router.use('/docs', swaggerUi.serve).get(
11+
'/docs',
12+
swaggerUi.setup(document, {
13+
customCssUrl: '/css/dark-theme-swagger.css',
14+
customSiteTitle: 'Evolution API',
15+
customfavIcon: '/images/logo.svg',
16+
}),
17+
);

0 commit comments

Comments
 (0)