Bind to the HTTP status page service
diff --git a/server/index.js b/server/index.js
index 2b30089..bc44f55 100644
--- a/server/index.js
+++ b/server/index.js
@@ -66,11 +66,11 @@
return res;
} catch (e) {
if (e instanceof NotFoundError) {
- return fetch("https://http-status-pages.jottocraft.com/?status=404&brand=dtps");
+ return env.HTTP_STATUS_PAGES.fetch("https://http-status-pages.jottocraft.com/?status=404&brand=dtps");
} else if (e instanceof MethodNotAllowedError) {
- return fetch("https://http-status-pages.jottocraft.com/?status=405&brand=dtps");
+ return env.HTTP_STATUS_PAGES.fetch("https://http-status-pages.jottocraft.com/?status=405&brand=dtps");
} else {
- return fetch("https://http-status-pages.jottocraft.com/?status=500&brand=dtps");
+ return env.HTTP_STATUS_PAGES.fetch("https://http-status-pages.jottocraft.com/?status=500&brand=dtps");
}
}
}
diff --git a/wrangler.toml b/wrangler.toml
index d2126ae..960fd36 100644
--- a/wrangler.toml
+++ b/wrangler.toml
@@ -4,6 +4,10 @@
account_id = "17174d3fc7098a664b04fb3c4c4ec65c"
workers_dev = false
+services = [
+ { binding = "HTTP_STATUS_PAGES", service = "http-status-pages" }
+]
+
[site]
bucket = "./build"