Skip to content

Commit 291f504

Browse files
authored
init
1 parent c965b19 commit 291f504

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

_worker.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
async fetch(request, env) {
3+
let url = new URL(request.url);
4+
if (url.pathname.startsWith('/')) {
5+
url.hostname="example.com";
6+
let new_request=new Request(url,request);
7+
return fetch(new_request);
8+
}
9+
// Otherwise, serve the static assets.
10+
return env.ASSETS.fetch(request);
11+
}
12+
};

0 commit comments

Comments
 (0)