planet-wars/frontend/www/index.js

15 lines
511 B
JavaScript
Raw Normal View History

2019-09-24 13:38:04 +00:00
import { set_game_name, set_instance } from './index.ts'
export { handle }
from './games.ts' // IMPORT GAMES PLEASE, thank you webpack <3
2019-09-17 12:03:16 +00:00
const URL = window.location.origin + window.location.pathname;
2019-09-14 08:48:20 +00:00
const LOCATION = URL.substring(0, URL.lastIndexOf("/") + 1);
2019-09-24 13:31:21 +00:00
const game_location = LOCATION + "static/games/Chandra Garrett.json";
2019-09-14 08:48:20 +00:00
2019-09-17 12:03:16 +00:00
fetch(game_location)
.then((r) => r.text())
.then((response) => {
set_instance(response);
2019-09-24 13:38:04 +00:00
set_game_name("Chandra Garrett");
}).catch(console.error);