same dek staging-dev
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Josh 2025-08-08 19:25:45 +00:00
parent 6a4d533c6d
commit c6a0305635
4 changed files with 42 additions and 30 deletions

2
.env
View File

@ -2,7 +2,7 @@ CORS_ALLOWED_ORIGINS=https://dev1.aptivaai.com,http://34.16.120.118:3000,http://
SERVER1_PORT=5000
SERVER2_PORT=5001
SERVER3_PORT=5002
IMG_TAG=a9421f5-202508081846
IMG_TAG=6a4d533-202508081922
ENV_NAME=dev
PROJECT=aptivaai-dev

View File

@ -100,15 +100,19 @@ app.use(
})
);
app.get('/healthz', async (req, res) => {
try {
await verifyCanary(pool); // throws if bad
return res.type('text').send('OK'); // cheap 200 OK
} catch (e) {
console.error('[HEALTHZ]', e.message);
return res.status(500).type('text').send('FAIL');
}
});
// LIVENESS: process is up; no external deps
app.get('/healthz', (req, res) => res.type('text').send('OK'));
// READINESS: KMS/DEK/DB are correct
app.get('/readyz', async (req, res) => {
try {
await verifyCanary(pool); // throws if bad
return res.type('text').send('READY');
} catch (e) {
console.error('[READYZ]', e.message);
return res.status(503).type('text').send('NOT_READY');
}
});
// Enable CORS with dynamic origin checking
app.use(

View File

@ -67,16 +67,20 @@ await verifyCanary(pool);
const app = express();
const PORT = process.env.SERVER2_PORT || 5001;
// at top of backend/server.js (do once per server codebase)
app.get('/healthz', async (req, res) => {
try {
await verifyCanary(pool); // << just pass the pool
return res.type('text').send('OK');
} catch (e) {
console.error('[HEALTHZ]', e.message);
return res.status(500).type('text').send('FAIL');
}
});
// LIVENESS: process is up; no external deps
app.get('/healthz', (req, res) => res.type('text').send('OK'));
// READINESS: KMS/DEK/DB are correct
app.get('/readyz', async (req, res) => {
try {
await verifyCanary(pool); // throws if bad
return res.type('text').send('READY');
} catch (e) {
console.error('[READYZ]', e.message);
return res.status(503).type('text').send('NOT_READY');
}
});
/**************************************************
* DB connections

View File

@ -71,16 +71,20 @@ const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2024-04-10',
});
// at top of backend/server.js (do once per server codebase)
app.get('/healthz', async (req, res) => {
try {
await verifyCanary(pool); // << just pass the pool
return res.type('text').send('OK');
} catch (e) {
console.error('[HEALTHZ]', e.message);
return res.status(500).type('text').send('FAIL');
}
});
// LIVENESS: process is up; no external deps
app.get('/healthz', (req, res) => res.type('text').send('OK'));
// READINESS: KMS/DEK/DB are correct
app.get('/readyz', async (req, res) => {
try {
await verifyCanary(pool); // throws if bad
return res.type('text').send('READY');
} catch (e) {
console.error('[READYZ]', e.message);
return res.status(503).type('text').send('NOT_READY');
}
});
function internalFetch(req, urlPath, opts = {}) {
return fetch(`${API_BASE}${urlPath}`, {