feat: base work

This commit is contained in:
TrèsAbhi committed 2025-11-28 13:19:15 -06:00
1 parent 4e170f2917
commit 4a20102de3
9 files changed
+42

No files matched your search

@@ -0,0 +1 @@
abstract class AbstractAPI {}
@@ -0,0 +1 @@
export class ClientAPI extends AbstractAPI {}
@@ -0,0 +1,12 @@
import { ClientAPI } from "./client";
import { ServerAPI } from "./server";
let dynamicAPI: AbstractAPI;
if (typeof window === "undefined") {
dynamicAPI = new ServerAPI();
} else {
dynamicAPI = new ClientAPI();
}
export const api = dynamicAPI;
@@ -0,0 +1 @@
export class ServerAPI extends AbstractAPI {}
@@ -0,0 +1,7 @@
import { ProxyClient } from "@blitzkit/closed";
export const proxyClient = await new ProxyClient(
import.meta.env.WOTB_SERVER
).handshake();
export const metadata = await proxyClient.metadata();
@@ -0,0 +1 @@
go to <a href="/tanks">/tanks</a>
@@ -0,0 +1,17 @@
---
import { api } from "../../core/api/dynamic";
const tanksList = await api.tanksList();
---
<h1>Tanks</h1>
<ul>
{
tanksList.map((tank) => (
<li>
<a href={`/tanks/${tank}`}>{tank}</a>
</li>
))
}
</ul>