worldmap-viewer

git clone https://git.godosa.eu/worldmap-viewer

master

raw · 422 bytes

// 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}` };
  }
}