fix: add health endpoint to git mirror

This commit is contained in:
Codex
2026-05-29 23:54:38 +08:00
parent c79bf656db
commit d891717f2f
+1 -1
View File
@@ -2841,7 +2841,7 @@ createServer((req, res) => {
async function handle(req, res) {
const url = new URL(req.url || "/", "http://git-mirror-http");
if (req.method === "GET" && url.pathname === "/") {
if (req.method === "GET" && (url.pathname === "/" || url.pathname === "/health")) {
res.writeHead(200, { "content-type": "application/json", "cache-control": "no-cache" });
res.end(JSON.stringify({ ok: true, service: "git-mirror-smart-http" }));
return;