mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
wait for health
This commit is contained in:
parent
8350fe4b08
commit
3b4a48932b
2
.github/workflows/cache-verify.yml
vendored
2
.github/workflows/cache-verify.yml
vendored
@ -282,7 +282,7 @@ jobs:
|
||||
|
||||
# Verwende die URIs aus .env
|
||||
wait_for "webapp" "$CLIENT_URI"
|
||||
wait_for "backend" "$GRAPHQL_URI"
|
||||
wait_for "backend" "$BACKEND_HEALTH"
|
||||
wait_for "mailserver" "http://localhost:1080"
|
||||
wait_for "minio" "http://localhost:9000/minio/health/live"
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ NEO4J_USERNAME=neo4j
|
||||
NEO4J_PASSWORD=letmein
|
||||
GRAPHQL_URI=http://localhost:4000
|
||||
CLIENT_URI=http://localhost:3000
|
||||
BACKEND_HEALTH=http://localhost:4000/api/health
|
||||
|
||||
# E-Mail default settings
|
||||
SUPPORT_EMAIL="devops@ocelot.social"
|
||||
|
||||
@ -84,6 +84,16 @@ const createServer = (options?) => {
|
||||
|
||||
const app = express()
|
||||
|
||||
// new health check
|
||||
app.get('/api/health', async (req, res) => {
|
||||
try {
|
||||
await serverDatabase.driver.verifyConnectivity()
|
||||
res.status(200).send({ status: 'ok' })
|
||||
} catch (err) {
|
||||
res.status(500).send({ status: 'unhealthy', error: err.message })
|
||||
}
|
||||
})
|
||||
|
||||
// TODO: this exception is required for the graphql playground, since the playground loads external resources
|
||||
// See: https://github.com/graphql/graphql-playground/issues/1283
|
||||
app.use(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user