aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2023-09-06 19:53:23 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2023-09-06 19:53:23 -0500
commitef4fb0a5277ee99bd0f1747b77e733ef7f02460d (patch)
tree2c7b306eaa814dedccb987a28a1cd050fdd94136 /utils
parenta66d6b395e22d6506319cc20b6dfab0e88cb0f39 (diff)
downloadhomepage-ef4fb0a5277ee99bd0f1747b77e733ef7f02460d.tar.xz
homepage-ef4fb0a5277ee99bd0f1747b77e733ef7f02460d.zip
Make BreadCrumbs domain agnostic
Diffstat (limited to 'utils')
-rw-r--r--utils/assert.tsx3
-rw-r--r--utils/env.tsx9
2 files changed, 12 insertions, 0 deletions
diff --git a/utils/assert.tsx b/utils/assert.tsx
new file mode 100644
index 0000000..0ee51a0
--- /dev/null
+++ b/utils/assert.tsx
@@ -0,0 +1,3 @@
+export default function assert(cond : boolean, message?: string) {
+ if(!cond) { throw Error(message); }
+};
diff --git a/utils/env.tsx b/utils/env.tsx
new file mode 100644
index 0000000..1894c1b
--- /dev/null
+++ b/utils/env.tsx
@@ -0,0 +1,9 @@
+import assert from './assert';
+
+const DISPLAY_DOMAIN = process.env.DISPLAY_DOMAIN;
+
+assert(DISPLAY_DOMAIN !== undefined, 'Please set DISPLAY_DOMAIN');
+
+export {
+ DISPLAY_DOMAIN
+};