wmc/skycraft/client.ts

15 lines
397 B
TypeScript

const backend = 'http://localhost:8080/api/';
/** Get all chunks for the given body */
export async function getBody(seed: number) {
const resp = await fetch(backend + `body/${seed}`);
return await resp.json();
}
/** Get a complete solar system */
export async function getSystem(seed: number) {
const resp = await fetch(backend + `system/${seed}`);
return await resp.json();
}