planet-wars/frontend/www/index.js

16 lines
504 B
JavaScript
Raw Normal View History

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