Small tweaks (cors etc)
This commit is contained in:
parent
1a1d07e5cb
commit
0c9a5093d0
5 changed files with 28 additions and 10 deletions
|
|
@ -9,10 +9,16 @@ import {
|
|||
} from "./api-types";
|
||||
|
||||
// Define API URL and base path
|
||||
const apiUrl =
|
||||
window.origin === "null" || window.origin === "http://localhost:3031"
|
||||
? "http://localhost:3030"
|
||||
: "";
|
||||
const apiUrl = (() => {
|
||||
if (window.origin === "null" || window.origin === "http://localhost:3031") {
|
||||
return "http://localhost:3030"
|
||||
}
|
||||
let port = /http.*:\/\/.*:(\d+)/.exec(window.origin)?.[1];
|
||||
if (port == "3031") {
|
||||
return window.origin.replace("3031", "3030");
|
||||
}
|
||||
return "";
|
||||
})();
|
||||
|
||||
const makeRequest = async (
|
||||
method: string,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue