[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
416 B

import { Config } from './types'
declare global {
interface Window {
flexorConfig?: Config
}
}
export default async function getConfig(): Promise<Config> {
if (window.flexorConfig) return window.flexorConfig
const response = await fetch('/config.json')
if (!response.ok) throw new Error()
const config = await response.json()
window.flexorConfig = config
return config
}