You've already forked healthcheck
Добавлен маршрут / с кодом 200
All checks were successful
Build and push Docker image / build (push) Successful in 49s
All checks were successful
Build and push Docker image / build (push) Successful in 49s
This commit is contained in:
@@ -18,7 +18,7 @@ async function getServiceStatusCode(service, node_id_or_name = null) {
|
|||||||
const tasks = await docker.listTasks({ filters: filters })
|
const tasks = await docker.listTasks({ filters: filters })
|
||||||
|
|
||||||
if (tasks.length === 0) {
|
if (tasks.length === 0) {
|
||||||
return 503
|
return 503
|
||||||
}
|
}
|
||||||
|
|
||||||
const isHealthy = tasks.some(task => {
|
const isHealthy = tasks.some(task => {
|
||||||
@@ -48,7 +48,6 @@ async function getServiceStatusCode(service, node_id_or_name = null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
app.get('/health/:service/:node', async (req, res) => {
|
app.get('/health/:service/:node', async (req, res) => {
|
||||||
const service = req.params.service
|
const service = req.params.service
|
||||||
const node = req.params.node
|
const node = req.params.node
|
||||||
@@ -75,7 +74,7 @@ app.get('/health/:service', async (req, res) => {
|
|||||||
res.sendStatus(statusCode)
|
res.sendStatus(statusCode)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.get('/', (_, res) => res.sendStatus(200))
|
||||||
app.use((_, response) => response.sendStatus(404))
|
app.use((_, response) => response.sendStatus(404))
|
||||||
|
|
||||||
const server = app.listen(PORT, () => {
|
const server = app.listen(PORT, () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user