Fix cross-worker fetch
diff --git a/src/app/routes/$404.tsx b/src/app/routes/$404.tsx
index 4c0d28c..6db5a8b 100644
--- a/src/app/routes/$404.tsx
+++ b/src/app/routes/$404.tsx
@@ -1,4 +1,4 @@
export async function loader() {
- const res = await fetch("https://http-status-pages.jottocraft.com/?brand=burya&status=404");
+ const res = await HTTP_STATUS_PAGES.fetch("https://http-status-pages.jottocraft.com/?brand=burya&status=404");
throw new Response(res.body, res);
}
\ No newline at end of file
diff --git a/src/bindings.d.ts b/src/bindings.d.ts
index 98cf370..5074052 100644
--- a/src/bindings.d.ts
+++ b/src/bindings.d.ts
@@ -2,4 +2,5 @@
declare global {
const RATATOSKR_CORE: Fetcher;
+ const HTTP_STATUS_PAGES: Fetcher;
}
\ No newline at end of file
diff --git a/wrangler.toml b/wrangler.toml
index 9917103..1efb220 100644
--- a/wrangler.toml
+++ b/wrangler.toml
@@ -7,7 +7,8 @@
compatibility_date = "2022-11-24"
services = [
- { binding = "RATATOSKR_CORE", service = "ratatoskr-core" }
+ { binding = "RATATOSKR_CORE", service = "ratatoskr-core" },
+ { binding = "HTTP_STATUS_PAGES", service = "http-status-pages" }
]
[site]