Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
xyTom authored May 15, 2022
1 parent c965b19 commit 291f504
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions _worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
async fetch(request, env) {
let url = new URL(request.url);
if (url.pathname.startsWith('/')) {
url.hostname="example.com";
let new_request=new Request(url,request);
return fetch(new_request);
}
// Otherwise, serve the static assets.
return env.ASSETS.fetch(request);
}
};

0 comments on commit 291f504

Please sign in to comment.