client side api path variable

This commit is contained in:
Jack 2021-12-13 21:58:15 +00:00
parent 82320266cd
commit fdd0dcd980

View file

@ -1,10 +1,12 @@
import axios from "axios";
let apiPath = "";
let baseURL;
if (window.location.hostname === "localhost") {
baseURL = "http://localhost:5005";
baseURL = "http://localhost:5005" + apiPath;
} else {
baseURL = "https://api.monkeytype.com";
baseURL = "https://api.monkeytype.com" + apiPath;
}
const axiosInstance = axios.create({