same dek staging-dev
This commit is contained in:
parent
c266a9d3b3
commit
1d82a6077c
2
.env
2
.env
@ -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
|
@ -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(
|
||||
|
@ -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
|
||||
|
@ -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}`, {
|
||||
|
Loading…
Reference in New Issue
Block a user