MyKindlebox/mykindlebox/client/vite.config.js

19 lines
608 B
JavaScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
// The client uses relative URLs (/api, /uploads). In dev, proxy those to the
// Node API server so the browser stays same-origin with the Vite dev server —
// this keeps session cookies working and lets a phone on the LAN hit the app
// at http://<dev-machine-ip>:5173 without the API resolving to the phone.
export default defineConfig({
plugins: [react()],
server: {
host: true,
proxy: {
'/api': 'http://localhost:3001',
'/uploads': 'http://localhost:3001',
},
},
})