diff options
author | LASER-Yi <[email protected]> | 2022-06-01 10:42:03 +0800 |
---|---|---|
committer | LASER-Yi <[email protected]> | 2022-06-01 10:42:03 +0800 |
commit | 03de446691df759ab6002f7886b56ef073d3e7ac (patch) | |
tree | 2f59c488a85494411884ee3fb47ce95de2a1f137 /frontend | |
parent | 56c461604730fe9ee10db96e7c94b1dcb0ddc5b3 (diff) | |
download | bazarr-03de446691df759ab6002f7886b56ef073d3e7ac.tar.gz bazarr-03de446691df759ab6002f7886b56ef073d3e7ac.zip |
not log: Fix base_url issue during development
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/config/configReader.ts | 7 | ||||
-rw-r--r-- | frontend/src/apis/queries/client.ts | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/frontend/config/configReader.ts b/frontend/config/configReader.ts index 20d28f81c..d0a90daa0 100644 --- a/frontend/config/configReader.ts +++ b/frontend/config/configReader.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ /// <reference types="node" /> import { readFile } from "fs/promises"; @@ -40,6 +41,8 @@ export default async function overrideEnv(env: Record<string, string>) { try { const apiKey = await read(configPath, "auth", "apikey"); + console.log(`Using API key: ${apiKey}`); + env["VITE_API_KEY"] = apiKey; process.env["VITE_API_KEY"] = apiKey; } catch (err) { @@ -54,7 +57,9 @@ export default async function overrideEnv(env: Record<string, string>) { const port = await read(configPath, "general", "port"); const baseUrl = await read(configPath, "general", "base_url"); - const url = `http://localhost:${port}${baseUrl}`; + const url = `http://127.0.0.1:${port}${baseUrl}`; + + console.log(`Using backend url: ${url}`); env["VITE_PROXY_URL"] = url; process.env["VITE_PROXY_URL"] = url; diff --git a/frontend/src/apis/queries/client.ts b/frontend/src/apis/queries/client.ts index 91a0af712..b89060bf5 100644 --- a/frontend/src/apis/queries/client.ts +++ b/frontend/src/apis/queries/client.ts @@ -1,4 +1,5 @@ import SocketIO from "@/modules/socketio"; +import { LOG } from "@/utilities/console"; import { setLoginRequired } from "@/utilities/event"; import Axios, { AxiosError, AxiosInstance, CancelTokenSource } from "axios"; import { Environment } from "../../utilities"; @@ -8,6 +9,9 @@ class BazarrClient { constructor() { const baseUrl = `${Environment.baseUrl}/api/`; + + LOG("info", "initializing BazarrClient with", baseUrl); + this.initialize(baseUrl, Environment.apiKey); SocketIO.initialize(); } |