Login page Authenticate and input icon
This commit is contained in:
@@ -2,19 +2,29 @@ import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
|
||||
// Both dev and preview forward /api/* to FastAPI, so a same-origin (relative)
|
||||
// request works whichever local server is delivering the page. Keep the two in
|
||||
// sync: `preview` serves dist/, and without this it would answer /api with a
|
||||
// 404 index.html, which surfaces in the UI as a login failure.
|
||||
const apiProxy = {
|
||||
'/api': {
|
||||
// Proxy all /api/* requests straight to FastAPI on port 8000
|
||||
target: 'http://127.0.0.1:8000',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true,
|
||||
},
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
// Proxy all /api/* requests straight to FastAPI on port 8000
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:8000',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
proxy: apiProxy,
|
||||
},
|
||||
preview: {
|
||||
port: 4173,
|
||||
proxy: apiProxy,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user