mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-24 22:44:50 -06:00
refac
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { browser, dev } from '$app/environment';
|
||||
// import { version } from '../../package.json';
|
||||
|
||||
// LICENSE covers this Open WebUI branding surface, including name, logo,
|
||||
@@ -7,8 +6,8 @@ import { browser, dev } from '$app/environment';
|
||||
// https://docs.openwebui.com/license.
|
||||
export const APP_NAME = 'Open WebUI';
|
||||
|
||||
export const WEBUI_HOSTNAME = browser ? (dev ? `${location.hostname}:8080` : ``) : '';
|
||||
export const WEBUI_BASE_URL = browser ? (dev ? `http://${WEBUI_HOSTNAME}` : ``) : ``;
|
||||
export const WEBUI_HOSTNAME = '';
|
||||
export const WEBUI_BASE_URL = '';
|
||||
export const WEBUI_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1`;
|
||||
|
||||
export const OLLAMA_API_BASE_URL = `${WEBUI_BASE_URL}/ollama`;
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
removeTerminalConnection
|
||||
} from '$lib/utils/connections';
|
||||
|
||||
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL, WEBUI_HOSTNAME } from '$lib/constants';
|
||||
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
|
||||
import {
|
||||
bestMatchingLanguage,
|
||||
cleanText,
|
||||
|
||||
@@ -3,6 +3,8 @@ import { defineConfig } from 'vite';
|
||||
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
|
||||
const backendTarget = 'http://localhost:8080';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
sveltekit(),
|
||||
@@ -23,6 +25,32 @@ export default defineConfig({
|
||||
build: {
|
||||
sourcemap: true
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: backendTarget,
|
||||
changeOrigin: true,
|
||||
ws: true
|
||||
},
|
||||
'/ollama': {
|
||||
target: backendTarget,
|
||||
changeOrigin: true
|
||||
},
|
||||
'/openai': {
|
||||
target: backendTarget,
|
||||
changeOrigin: true
|
||||
},
|
||||
'/oauth': {
|
||||
target: backendTarget,
|
||||
changeOrigin: true
|
||||
},
|
||||
'/ws': {
|
||||
target: backendTarget,
|
||||
changeOrigin: true,
|
||||
ws: true
|
||||
}
|
||||
}
|
||||
},
|
||||
worker: {
|
||||
format: 'es'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user