Skip to content

Commit

Permalink
[Fix] 🐛 Cloudflare Deploy BaseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed Jan 18, 2024
1 parent 96332d8 commit 8f6702f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cloudflare/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,15 @@ const home = async (pathname) => {
let url;
if (pathname.indexOf('/web/') === 0) {
url = pathname.replace('/web/', baseUrl+'web/');
if (pathname == '/web/') {
url += 'index.html';
}
} else {
url = baseUrl + 'web/index.html';
let res = new Response('', {
status: 302,
});
res.headers.set("location", "/web/");
return res;
}
const res = await fetch(url);
const result = await rewriteBody(res);
Expand Down

0 comments on commit 8f6702f

Please # to comment.