import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    proxy: {
      // 只要你请求以 /api 开头，就会被转发到目标服务器
      '/api': {
        target: 'http://192.168.1.196:9001',
        changeOrigin: true,
      },
      '/photos':{
        target: 'http://8.130.135.159:8084',
        changeOrigin: true,
      },
      '/geoserver': {
        // 注意：这里必须写 /geoserver 结尾，且没有拼写错误
        target: 'http://8.130.135.159:8000/geoserver', 
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/geoserver/, '')
      },
    },
  },
})


