Merge pull request #588 from pikasTech/fix/git-mirror-health-endpoint

fix: add health endpoint to git mirror
This commit is contained in:
Lyon
2026-05-29 23:55:12 +08:00
committed by GitHub
+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;