parent
f7c5d70740
commit
247825bdd3
8 changed files with 126 additions and 35 deletions
14
.cloudflare/docs-proxy/src/worker.js
Normal file
14
.cloudflare/docs-proxy/src/worker.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
export default {
|
||||
async fetch(request, _env, _ctx) {
|
||||
const url = new URL(request.url);
|
||||
url.hostname = "docs-anw.pages.dev";
|
||||
|
||||
let res = await fetch(url, request);
|
||||
|
||||
if (res.status === 404) {
|
||||
res = await fetch("https://zed.dev/404");
|
||||
}
|
||||
|
||||
return res;
|
||||
},
|
||||
};
|
8
.cloudflare/docs-proxy/wrangler.toml
Normal file
8
.cloudflare/docs-proxy/wrangler.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
name = "docs-proxy"
|
||||
main = "src/worker.js"
|
||||
compatibility_date = "2024-05-03"
|
||||
workers_dev = true
|
||||
|
||||
[[routes]]
|
||||
pattern = "zed.dev/docs*"
|
||||
zone_name = "zed.dev"
|
Loading…
Add table
Add a link
Reference in a new issue