monorepo/kifu/pwa/src/main.ts

22 lines
551 B
TypeScript
Raw Normal View History

import { GoBoard } from "./components/Board";
2023-05-11 13:39:31 +00:00
import { CoreApi, initCore } from "./coreApi";
2023-05-10 13:42:02 +00:00
const main = async () => {
2023-05-11 13:39:31 +00:00
let coreApi = await initCore();
let response = await coreApi.playingField();
2023-05-10 13:42:02 +00:00
console.log("playing field response: ", response);
const root = document.getElementById("root");
if (!root) {
alert("could not retrieve the app root container");
return;
}
2023-05-14 02:16:24 +00:00
const board = new GoBoard(response.board);
root.appendChild(board.canvas);
console.log("constructed board: ", board);
2023-05-14 02:16:24 +00:00
board.renderBoard();
2023-05-10 13:42:02 +00:00
};
main();