mirror of
https://github.com/Krafpy/KSP-MGA-Planner.git
synced 2025-12-05 20:40:13 -08:00
Modified the file structure to have the `index.html` at the root of the repository. Needed for Github Pages.
19 lines
513 B
JavaScript
19 lines
513 B
JavaScript
async function readTextFile(path) {
|
|
const response = await fetch(path);
|
|
const text = await response.text();
|
|
return text;
|
|
}
|
|
export async function loadBodiesData() {
|
|
const content = await readTextFile("./data/kspbodies.yml");
|
|
const data = jsyaml.load(content);
|
|
return {
|
|
sun: data[0],
|
|
bodies: data.slice(1)
|
|
};
|
|
}
|
|
export async function loadConfig() {
|
|
const content = await readTextFile("./data/config.yml");
|
|
const config = jsyaml.load(content);
|
|
return config;
|
|
}
|