feat: update frontend path to '/badge' and adjust related documentation
This commit is contained in:
@@ -345,7 +345,7 @@ test.describe('Sicurezza Backend', () => {
|
||||
let requestIntercepted = false;
|
||||
let backendResponse: { success: boolean; message: string } | null = null;
|
||||
|
||||
await page.route('**/entry-request', async (route, request) => {
|
||||
await page.route('**/api/entry-request', async (route, request) => {
|
||||
requestIntercepted = true;
|
||||
console.log('[E2E] ⚠️ Richiesta entry-request INTERCETTATA');
|
||||
console.log('[E2E] Body:', request.postData());
|
||||
|
||||
@@ -19,8 +19,8 @@ export default defineConfig({
|
||||
},
|
||||
|
||||
use: {
|
||||
// URL base del server
|
||||
baseURL: 'http://localhost:8000',
|
||||
// URL base del server (frontend servito su /badge)
|
||||
baseURL: 'http://localhost:8000/badge',
|
||||
|
||||
// Rallenta le azioni per vedere cosa succede
|
||||
launchOptions: {
|
||||
|
||||
@@ -6,12 +6,12 @@ import App from './App.tsx'
|
||||
import {DebugScreen} from './screens'
|
||||
|
||||
function DebugWrapper() {
|
||||
return <DebugScreen onBack={() => window.location.href = '/'}/>
|
||||
return <DebugScreen onBack={() => window.location.href = '/badge'}/>
|
||||
}
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<BrowserRouter>
|
||||
<BrowserRouter basename="/badge">
|
||||
<Routes>
|
||||
<Route path="/" element={<App/>}/>
|
||||
<Route path="/debug" element={<DebugWrapper/>}/>
|
||||
|
||||
@@ -7,8 +7,8 @@ import tailwindcss from '@tailwindcss/vite'
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
|
||||
// Path relativi per funzionare su qualsiasi IP/porta
|
||||
base: './',
|
||||
// Base path per il frontend servito su /badge
|
||||
base: '/badge/',
|
||||
|
||||
// Build nella cartella dist del frontend
|
||||
build: {
|
||||
@@ -30,22 +30,10 @@ export default defineConfig({
|
||||
},
|
||||
|
||||
// Proxy API in sviluppo verso il backend (porta 8000)
|
||||
// In produzione il backend serve direttamente il frontend
|
||||
// In produzione il backend serve il frontend su /badge e le API su /api/*
|
||||
server: {
|
||||
proxy: {
|
||||
'/info-room': {
|
||||
target: 'http://127.0.0.1:8000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/login-validate': {
|
||||
target: 'http://127.0.0.1:8000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/anagrafica': {
|
||||
target: 'http://127.0.0.1:8000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/entry-request': {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:8000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user