srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/main.js
blob: 3967db4c4a7de75e12abb364f3324b19eedddc37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { startApp } from './app.js';

async function loadLocalTexts() {
    try {
        const res = await fetch(new URL('./data/texts.json', import.meta.url));
        const data = await res.json();
        return Array.isArray(data) ? data : [];
    } catch (err) {
        console.error('Failed to load local texts:', err);
        return [];
    }
}

loadLocalTexts().then(texts => {
    startApp(document.getElementById('root'), texts);
});