Files
vessel/frontend/vite.config.ts

32 lines
786 B
TypeScript

import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
// Use environment variable or default to localhost (works with host network mode)
const ollamaUrl = process.env.OLLAMA_API_URL || 'http://localhost:11434';
const backendUrl = process.env.BACKEND_URL || 'http://localhost:9090';
const devPort = parseInt(process.env.DEV_PORT || '7842', 10);
export default defineConfig({
plugins: [sveltekit()],
server: {
port: devPort,
proxy: {
// Backend health check
'/health': {
target: backendUrl,
changeOrigin: true
},
// Go backend API (must be before /api to match first)
'/api/v1': {
target: backendUrl,
changeOrigin: true
},
// Ollama API
'/api': {
target: ollamaUrl,
changeOrigin: true
}
}
}
});