From ab4a670becaedb6906453b31d66d6a7e7fb44ad3 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 5 Feb 2024 00:33:07 +0800 Subject: [PATCH] chore: add env example --- web/.env.example | 1 + web/src/helpers/api.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 web/.env.example diff --git a/web/.env.example b/web/.env.example new file mode 100644 index 00000000..0f4e8826 --- /dev/null +++ b/web/.env.example @@ -0,0 +1 @@ +VITE_API_BASE_URL=http://localhost:8081 diff --git a/web/src/helpers/api.ts b/web/src/helpers/api.ts index 0d6a26a7..f318d1ef 100644 --- a/web/src/helpers/api.ts +++ b/web/src/helpers/api.ts @@ -1,7 +1,7 @@ import axios from "axios"; import { Resource } from "@/types/proto/api/v2/resource_service"; -axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL || window.location.origin; +axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL || ""; axios.defaults.withCredentials = true; export function getSystemStatus() {