Harden production deployment lifecycle
This commit is contained in:
1 parent
3fbf2743d0
commit
5aa16b0f05
11 files changed
+475
-35
No files matched your search
@@ -0,0 +1,11 @@
|
||||
const port = process.env.PORT || 3000;
|
||||
const url = `http://127.0.0.1:${port}/health/ready`;
|
||||
|
||||
fetch(url, { signal: AbortSignal.timeout(4000) })
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error(`readiness returned ${response.status}`);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error.message);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in new issue
Block a user