Skip to content

Commit f6e2fd9

Browse files
committed
Saving progress
1 parent 72672b6 commit f6e2fd9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "labelzoom-cf-api-proxy",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"private": true,
55
"scripts": {
66
"deploy": "wrangler deploy",

src/index.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ export default {
8989
return Response.redirect(request.url + '/' + url.search);
9090
}
9191

92-
return new Response(`Not found`, { status: 404 });
92+
// TODO: Eventually we'll wall off access to the rest of the endpoints once everything has been fully migrated
93+
// return new Response(`Not found`, { status: 404 });
94+
95+
// Fallthrough behavior, proxy request to Spring Web
96+
return responseWithAllowOrigin(
97+
await fetch(
98+
requestProxyToBackend(request, url, env)
99+
),
100+
request.headers.get('Origin') ?? '*'
101+
);
93102
},
94103
} satisfies ExportedHandler<Env>;

0 commit comments

Comments
 (0)