diff --git a/apps/broker/src/index.ts b/apps/broker/src/index.ts index c28fc67..4a86185 100644 --- a/apps/broker/src/index.ts +++ b/apps/broker/src/index.ts @@ -592,6 +592,21 @@ function handleHttpRequest(req: IncomingMessage, res: ServerResponse): void { return; } + // --- Test endpoints for URL watch validation --- + if (req.method === "GET" && req.url === "/test/clock") { + writeJson(res, 200, { time: new Date().toISOString(), epoch: Date.now() }); + return; + } + if (req.method === "GET" && req.url === "/test/flip") { + writeJson(res, 200, { value: Math.random() > 0.5 ? "heads" : "tails", at: Date.now() }); + return; + } + if (req.method === "GET" && req.url === "/test/html") { + res.writeHead(200, { "Content-Type": "text/html" }); + res.end(`
Counter: ${Date.now()}
`); + return; + } + res.writeHead(404); res.end("not found"); log.debug("http", { route, status: 404, latency_ms: Date.now() - started });