mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
client side api path variable
This commit is contained in:
parent
82320266cd
commit
fdd0dcd980
1 changed files with 4 additions and 2 deletions
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue