diff options
Diffstat (limited to 'src/lib/constants.ts')
-rw-r--r-- | src/lib/constants.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/constants.ts b/src/lib/constants.ts new file mode 100644 index 0000000..dc84994 --- /dev/null +++ b/src/lib/constants.ts @@ -0,0 +1,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
\ No newline at end of file |