feat:CI/CD Gitea 워크플로우 등 누락 파일 반영
Some checks failed
ITAM Code Check / build-and-config-check (push) Failing after 11s
ITAM Docker Build Check / docker-build-check (push) Successful in 39s

This commit is contained in:
2026-06-18 13:39:35 +09:00
parent 9d19d8283e
commit fa8dec1780
33 changed files with 4696 additions and 2011 deletions

View File

@@ -742,6 +742,31 @@ app.post('/api/upload', (req, res) => {
}
});
// Health check endpoint for container orchestration
app.get('/health', async (req, res) => {
try {
const connection = await pool.getConnection();
const result = await connection.query('SELECT 1');
connection.release();
res.status(200).json({ status: 'ok', db: 'connected' });
} catch (err) {
// Return degraded status if DB unreachable, but still report service as alive
res.status(200).json({ status: 'degraded', db: 'unreachable', error: err.message });
}
});
// Readiness check endpoint (only returns 200 if fully ready)
app.get('/ready', async (req, res) => {
try {
const connection = await pool.getConnection();
const result = await connection.query('SELECT 1');
connection.release();
res.status(200).json({ status: 'ready' });
} catch (err) {
res.status(503).json({ status: 'not_ready', error: err.message });
}
});
app.listen(3000, '0.0.0.0', () => {
console.log('📡 ITAM BACKEND SERVER RUNNING ON PORT 3000 (V3 Normalized)');
});