Supports customizing the API server address of the Web frontend through the --api-host parameter (#913)

This commit is contained in:
Mg Pig
2025-06-02 06:46:12 +08:00
committed by GitHub
parent 0a38a8ef4a
commit b469f8197a
7 changed files with 150 additions and 55 deletions
+11
View File
@@ -3,9 +3,20 @@ import vue from '@vitejs/plugin-vue'
// import { viteSingleFile } from "vite-plugin-singlefile"
const WEB_BASE_URL = process.env.WEB_BASE_URL || '';
const API_BASE_URL = process.env.API_BASE_URL || 'http://localhost:11211';
// https://vite.dev/config/
export default defineConfig({
base: WEB_BASE_URL,
plugins: [vue(),/* viteSingleFile() */],
server: {
proxy: {
"/api": {
target: API_BASE_URL,
},
"/api_meta.js": {
target: API_BASE_URL,
},
}
}
})