Fix: healthcheck could shutdown during migration

This commit is contained in:
Louis Lam
2025-10-20 23:56:02 +08:00
parent bbc0917acd
commit 5946e684db

View File

@@ -37,6 +37,18 @@ class SimpleMigrationServer {
this.server = http.createServer(this.app);
this.app.get("/", (req, res) => {
res.set("Content-Type", "text/html");
// HTML meta tag redirect to /status
res.end(`
<html lang="en">
<head><meta http-equiv="refresh" content="0; URL=/migrate-status" /></head>
<body>Migration server is running.</body>
</html>
`);
});
this.app.get("/migrate-status", (req, res) => {
res.set("Content-Type", "text/plain");
res.write("Migration is in progress, listening message...\n");
if (this.response) {