diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
| commit | 3443c1c65e9f1753e1e656b35d08416c1fa298f2 (patch) | |
| tree | 4e43236f460145a4d75d1b4616dcb7aa6ef08f51 /viewer/js/boot.js | |
| download | worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.tar.gz worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.zip | |
worldmap-viewer: initial public history
Diffstat (limited to 'viewer/js/boot.js')
| -rw-r--r-- | viewer/js/boot.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/viewer/js/boot.js b/viewer/js/boot.js new file mode 100644 index 0000000..edaf2ef --- /dev/null +++ b/viewer/js/boot.js @@ -0,0 +1,10 @@ +// boot.js — the first /api/meta: the era in the URL, else the default one. +export async function metaFor(get, era) { + if (!era) return { meta: await get('api/meta'), note: '' }; + try { + return { meta: await get(`api/meta?era=${encodeURIComponent(era)}`), note: '' }; + } catch (e) { + const meta = await get('api/meta'); + return { meta, note: `Era “${era}”: ${e.message} — showing ${meta.era}` }; + } +} |
