Testversion im Browser und Sicherung einspielen
Die Testversion bündelt Oberfläche und Server-Logik mit PGlite (Postgres als WebAssembly). POST /api/import/stand spielt einen kompletten Stand mit allen IDs in ein leeres Programm ein; damit ziehen die Daten später auf den Server um. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
15
demo/node.ts
Normal file
15
demo/node.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// Was src/server/app.ts aus Node braucht, für den Browser nachgebaut.
|
||||
export const existsSync = () => false;
|
||||
export const fileURLToPath = (u: string) => u;
|
||||
export default { join: (...t: string[]) => t.join("/"), dirname: (p: string) => p };
|
||||
|
||||
export function randomBytes(n: number) {
|
||||
const b = crypto.getRandomValues(new Uint8Array(n));
|
||||
return { toString: () => btoa(String.fromCharCode(...b)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "") };
|
||||
}
|
||||
|
||||
export function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean {
|
||||
return a.length === b.length && a.every((x, i) => x === b[i]);
|
||||
}
|
||||
|
||||
(globalThis as any).Buffer ??= { from: (s: string) => new TextEncoder().encode(s) };
|
||||
Reference in New Issue
Block a user