Fix frontend API: use relative /api with Vite proxy to agent
CI / basic-check (push) Has been cancelled
CI / basic-check (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import type { NetObject, ServiceInfo } from '../types';
|
import type { NetObject, ServiceInfo } from '../types';
|
||||||
|
|
||||||
const AGENT_BASE = 'http://127.0.0.1:8001';
|
const AGENT_BASE = '/api';
|
||||||
|
|
||||||
export async function fetchObjects(): Promise<NetObject[]> {
|
export async function fetchObjects(): Promise<NetObject[]> {
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import react from '@vitejs/plugin-react';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
server: {
|
||||||
|
host: '0.0.0.0',
|
||||||
|
port: 5173,
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://127.0.0.1:8001',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user