mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 21:26:08 +01:00
feat: start of scraping
This commit is contained in:
1 parent
4a20102de3
commit
ef154f99d5
11 files changed
+73
-19
No files matched your search
@@ -1,11 +1,20 @@
|
||||
import { ClientAPI } from "./client";
|
||||
import { ServerAPI } from "./server";
|
||||
import type { AbstractAPI } from "./abstract";
|
||||
|
||||
let dynamicAPI: AbstractAPI;
|
||||
|
||||
if (typeof window === "undefined") {
|
||||
dynamicAPI = new ServerAPI();
|
||||
const { ProxyClient } = await import("@blitzkit/closed");
|
||||
const { ServerAPI } = await import("./server");
|
||||
|
||||
const proxyClient = await new ProxyClient(
|
||||
import.meta.env.WOTB_SERVER
|
||||
).handshake();
|
||||
const metadata = await proxyClient.metadata();
|
||||
|
||||
dynamicAPI = new ServerAPI(metadata);
|
||||
} else {
|
||||
const { ClientAPI } = await import("./client");
|
||||
|
||||
dynamicAPI = new ClientAPI();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user