summaryrefslogtreecommitdiff
path: root/src/index.tsx
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2024-03-12 14:52:25 +0000
committerSam Nystrom <sam@samnystrom.dev>2024-03-12 17:34:56 -0400
commita9aa246f58dcb2664c4e7a1bd98e69c19e7d7000 (patch)
tree2795ec23ec748024dd863215a9735cb8c3825579 /src/index.tsx
parent367fe51e7e1c55e39299e2e667ca4f399a474019 (diff)
Add rudimentary backend and auth
Diffstat (limited to 'src/index.tsx')
-rw-r--r--src/index.tsx18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/index.tsx b/src/index.tsx
index bff0b70..610fb70 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,11 +1,25 @@
import { render } from 'preact';
+import { useMemo } from 'preact/hooks';
+import { Router } from 'preact-router';
+import PocketBase from 'pocketbase';
+import { Pb } from './pb.ts';
+import { Home, SignUp, LogIn, ProjectsList } from './pages';
import { NodeEditor } from './NodeEditor.tsx';
import './index.css';
export const App = () => {
+ const pb = useMemo(() => new PocketBase(`https://${window.location.hostname}:8080/`));
return (
- <NodeEditor />
+ <Pb.Provider value={pb}>
+ <Router>
+ <Home path="/" />
+ <SignUp path="/signup" />
+ <LogIn path="/login" />
+ <ProjectsList path="/:user" />
+ <NodeEditor path="/:user/:project" />
+ </Router>
+ </Pb.Provider>
);
};
-render(<App />, document.body);
+render(<App />, document.body); \ No newline at end of file