import axios from 'axios' declare var process : { env: { NODE_ENV: string } } export class Api { public readonly api_url: string; constructor() { if (process.env.NODE_ENV === 'development') { this.api_url = 'http://localhost:5000/'; } else { this.api_url = 'https://api.agorata.io/'; } } } export const config = new Api(); export async function call_api(url: string) { return (await axios.get(config.api_url + url, {withCredentials: true})).data; }