fix: allow server address as url without path
This commit is contained in:
parent
f74c10d4aa
commit
2176c6c3cf
3 changed files with 4 additions and 4 deletions
|
@ -7,8 +7,8 @@ import { config } from "./config";
|
|||
|
||||
let devMode = process.env.NODE_ENV === "development";
|
||||
|
||||
let host = devMode ? "localhost:5000" : (config.server_address ?? "");
|
||||
let url = devMode ? "http://" + host : (host ? "https://" : "") + host;
|
||||
let host = devMode ? "localhost:5000" : (config.server_address ?? "").replace(/(^\w+:|^)\/\//, "");
|
||||
let url = devMode ? "http://" + host : config.server_address;
|
||||
|
||||
const http = axios.create({
|
||||
baseURL: url + "/api",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue