aboutsummaryrefslogtreecommitdiff
path: root/src/lib/constants.ts
blob: dc849945ee95dd58d6d6c4480863455a9da47f38 (plain)
1
2
3
4
5
6
7
8
9
10
11
import { API_URL } from '$lib/api'

export let constants: any = {}

async function updateConstants() {
    constants = await fetch(API_URL + 'constants').then(r => r.json())
    console.log('updated constants')
}

updateConstants()
setInterval(updateConstants, 60 * 60 * 1000) // update every hour