Ver código fonte

:wrench: add REACT_APP_API_BASE env support

China Kassapa 2 meses atrás
pai
commit
f096c06a75

+ 1 - 0
dashboard-v4/dashboard/.env.development

@@ -0,0 +1 @@
+REACT_APP_API_BASE=""

+ 1 - 0
dashboard-v4/dashboard/.env.orig

@@ -15,3 +15,4 @@ REACT_APP_API_SERVER=https://www.wikipali.org
 REACT_APP_ICP_CODE=
 REACT_APP_QUESTIONNAIRE_LINK=
 REACT_APP_OPENAI_PROXY=https://staging.ai.jp.wikipali.org/api/openai
+REACT_APP_API_BASE=""

+ 2 - 1
dashboard-v4/dashboard/package.json

@@ -1,7 +1,8 @@
 {
   "name": "dashboard",
-  "version": "0.1.0",
+  "version": "2026.1.20",
   "private": true,
+  "proxy": "http://localhost:8000",
   "dependencies": {
     "@ant-design/charts": "^1.4.2",
     "@ant-design/pro-components": "^2.3.32",

+ 2 - 0
dashboard-v4/dashboard/src/api/index.ts

@@ -0,0 +1,2 @@
+export const api_url = (path: string) =>
+  `${process.env.REACT_APP_API_BASE}${path}`;

+ 1 - 0
dashboard-v6/.env.development

@@ -0,0 +1 @@
+VITE_API_BASE=""

+ 4 - 27
dashboard-v6/.gitignore

@@ -1,27 +1,4 @@
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
-
-node_modules
-dist
-dist-ssr
-*.local
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
-.idea
-.DS_Store
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
-
-# my add
-package-lock.json
+/node_modules/
+/dist/
+/package-lock.json
+/.env

+ 2 - 0
dashboard-v6/src/api/index.ts

@@ -0,0 +1,2 @@
+export const api_url = (path: string) =>
+  `${import.meta.env.VITE_API_BASE}${path}`;

+ 1 - 2
dashboard-v6/vite.config.ts

@@ -8,8 +8,7 @@ export default defineConfig({
     host: "127.0.0.1",
     port: 4000,
     proxy: {
-      "/api": "http://127.0.0.1:8080",
-      "/api-v2026": "http://127.0.0.1:8088",
+      "/api": "http://127.0.0.1:8000",
     },
   },
   plugins: [react()],