Update Dockerfile and docker-compose.yml to change application port to 6060; add health check endpoint. Add cookie dependency to package.json and create health check API endpoint.

This commit is contained in:
2025-08-06 14:57:19 +02:00
parent d0075f5b12
commit ae928bbb9b
5 changed files with 43 additions and 7 deletions

29
server/api/health.get.ts Normal file
View File

@@ -0,0 +1,29 @@
export default defineEventHandler(async (event) => {
try {
// Basic health check - can be expanded to check database, storage, etc.
const health = {
status: 'healthy',
timestamp: new Date().toISOString(),
uptime: process.uptime(),
checks: {
server: 'healthy',
// Add more checks as needed
// database: await checkDatabase(),
// storage: await checkStorage(),
// auth: await checkAuth(),
},
};
return health;
} catch (error) {
throw createError({
statusCode: 503,
statusMessage: 'Service Unavailable',
data: {
status: 'unhealthy',
timestamp: new Date().toISOString(),
error: error instanceof Error ? error.message : 'Unknown error',
},
});
}
});