lets fuckin go
This commit is contained in:
4
packages/client/src/api.ts
Normal file
4
packages/client/src/api.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { hc } from "hono/client";
|
||||
import { type ApiType } from "../../server/src/api";
|
||||
|
||||
export default hc<ApiType>("http://localhost:5001/api");
|
||||
@@ -1,7 +1,9 @@
|
||||
import "./app.css";
|
||||
import "./style.css";
|
||||
import { Route, Router } from "@solidjs/router";
|
||||
import { Suspense } from "solid-js";
|
||||
import { lazy, Suspense } from "solid-js";
|
||||
import pkg from "../package.json";
|
||||
import { render } from "solid-js/web";
|
||||
import Root from "./routes/index";
|
||||
|
||||
const Version = () => (
|
||||
<div class="full free clear">
|
||||
@@ -19,17 +21,21 @@ const Version = () => (
|
||||
</div>
|
||||
);
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<Router
|
||||
root={(props) => (
|
||||
<>
|
||||
<Suspense>{props.children}</Suspense>
|
||||
<Version />
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<Route path="/" component={() => "tesingt"} />
|
||||
</Router>
|
||||
);
|
||||
}
|
||||
const App = () => (
|
||||
<Router
|
||||
root={(props) => (
|
||||
<>
|
||||
<Suspense>{props.children}</Suspense>
|
||||
<Version />
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<Route path="/" component={lazy(() => import("./routes/index"))} />
|
||||
<Route
|
||||
path="/:game"
|
||||
component={lazy(() => import("./routes/[game]/index"))}
|
||||
/>
|
||||
</Router>
|
||||
);
|
||||
|
||||
render(App, document.getElementById("app")!);
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import App from "./app";
|
||||
import { render } from "solid-js/web";
|
||||
|
||||
render(App, document.getElementById("app")!);
|
||||
@@ -1,14 +1,19 @@
|
||||
import { A } from "@solidjs/router";
|
||||
import { createResource, For } from "solid-js";
|
||||
import { createEffect, createResource, For } from "solid-js";
|
||||
import * as Games from "../db/Games";
|
||||
import api from "../api";
|
||||
|
||||
export default () => {
|
||||
const [games] = createResource(() => Games.queryAll());
|
||||
const [ping] = createResource(async () =>
|
||||
api.ping.$get().then(async (res) => await res.text())
|
||||
);
|
||||
|
||||
return (
|
||||
<div style={{ padding: "20px" }}>
|
||||
<For each={games()}>
|
||||
{ping()}
|
||||
{/* <For each={games()}>
|
||||
{(game) => <A href={`/${game.name}`}>{game.name}</A>}
|
||||
</For>
|
||||
</For> */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user