Skip to content

Commit e712d76

Browse files
committed
Fix API documentation deployment and add health check
1 parent 6597cb4 commit e712d76

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ npm start
8686

8787
- **Live Demo:** [https://edms-blue.vercel.app/](https://edms-blue.vercel.app/)
8888
- **API Docs:** [https://edms-blue.vercel.app/api-docs](https://edms-blue.vercel.app/api-docs)
89-
- **GitHub:** [View Source Code](https://github.com/your-username/edms)
89+
- **GitHub:** [View Source Code](https://github.com/bennytobby/edms)
9090

9191
---
9292

server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,15 @@ app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec, {
195195
customSiteTitle: 'EDMS API Documentation'
196196
}));
197197

198+
// Health check for API docs
199+
app.get('/api-docs-health', (req, res) => {
200+
res.json({
201+
status: 'API Documentation is running',
202+
endpoints: Object.keys(swaggerSpec.paths || {}).length,
203+
timestamp: new Date().toISOString()
204+
});
205+
});
206+
198207
// Vercel Analytics - track is used directly in routes
199208

200209
// Performance monitoring middleware

vercel.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@
77
}
88
],
99
"routes": [
10+
{
11+
"src": "/api-docs(.*)",
12+
"dest": "server.js"
13+
},
1014
{
1115
"src": "/(.*)",
1216
"dest": "server.js"
1317
}
1418
],
1519
"env": {
1620
"NODE_ENV": "production"
21+
},
22+
"functions": {
23+
"server.js": {
24+
"maxDuration": 30
25+
}
1726
}
1827
}

0 commit comments

Comments
 (0)