ops(relay): bridge production traffic to Fly

This commit is contained in:
Mohamed Boudra
2026-07-11 16:49:15 +02:00
parent c800c6a3f1
commit 5ae53c7e55
5 changed files with 117 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
interface CutoverProxy {
fetch(request: Request): Promise<Response>;
}
export function createCutoverProxy(origin: string): CutoverProxy {
const originUrl = new URL(origin);
return {
async fetch(request: Request): Promise<Response> {
const upstreamUrl = new URL(request.url);
upstreamUrl.protocol = originUrl.protocol;
upstreamUrl.host = originUrl.host;
return fetch(new Request(upstreamUrl, request));
},
};
}