aboutsummaryrefslogtreecommitdiff
path: root/server/frontend/src/index.tsx
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-01-17 15:30:04 +0100
committerLinnea Gräf <nea@nea.moe>2025-01-17 15:30:04 +0100
commitaa7e28e799ce19f04c6c33782ea8d25ef4c3bb98 (patch)
treea84f850c1f88ce3c8a16b2fdb5de52fba3ad0edb /server/frontend/src/index.tsx
parentf49de9677285ba6287d049a6187ff00bf90ee77f (diff)
downloadLocalTransactionLedger-aa7e28e799ce19f04c6c33782ea8d25ef4c3bb98.tar.gz
LocalTransactionLedger-aa7e28e799ce19f04c6c33782ea8d25ef4c3bb98.tar.bz2
LocalTransactionLedger-aa7e28e799ce19f04c6c33782ea8d25ef4c3bb98.zip
feat(Server): Add frontend starter
Diffstat (limited to 'server/frontend/src/index.tsx')
-rw-r--r--server/frontend/src/index.tsx21
1 files changed, 21 insertions, 0 deletions
diff --git a/server/frontend/src/index.tsx b/server/frontend/src/index.tsx
new file mode 100644
index 0000000..023872c
--- /dev/null
+++ b/server/frontend/src/index.tsx
@@ -0,0 +1,21 @@
+/* @refresh reload */
+import {render} from "solid-js/web";
+
+import "./index.css";
+import type {RouteDefinition} from "@solidjs/router";
+import {Router} from "@solidjs/router";
+import {lazy} from "solid-js";
+
+const root = document.getElementById("root");
+
+if (!(root instanceof HTMLElement)) {
+ throw new Error(
+ "Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?"
+ );
+}
+const routes: Array<RouteDefinition> = [
+ {path: '/', component: lazy(() => import("./App.tsx"))},
+ {path: "/test/", component: lazy(() => import("./Test.tsx"))}
+]
+
+render(() => <Router>{routes}</Router>, root!);