feat: configure API dev proxy and improve useApiFetch error handling
- Add Nitro devProxy for local proxying of api/v1 and uploads to the backend server - Improve useApiFetch to dynamically clear auth state and navigate to login on 401/403 errors - Automatically strip Content-Type headers for multipart FormData upload request bodies - Add css rule to fix Bootstrap Italia navbar link border display - Add ts-expect-error tag to avoid type checking issues with bootstrap-italia bundle loading
This commit is contained in:
@@ -20,6 +20,29 @@ export default defineNuxtConfig({
|
||||
url: 'http://localhost:3000',
|
||||
name: 'Visione - Un\'occhio per la sicurezza del cittadino.',
|
||||
},
|
||||
|
||||
nitro: {
|
||||
devProxy: {
|
||||
'/api/v1': {
|
||||
target: 'https://bk.visione.studentindipendenti.it/api/v1',
|
||||
changeOrigin: true,
|
||||
headers: {
|
||||
host: 'bk.visione.studentindipendenti.it',
|
||||
origin: 'https://visione.studentindipendenti.it',
|
||||
referer: 'https://visione.studentindipendenti.it/'
|
||||
}
|
||||
},
|
||||
'/uploads': {
|
||||
target: 'https://bk.visione.studentindipendenti.it/uploads',
|
||||
changeOrigin: true,
|
||||
headers: {
|
||||
host: 'bk.visione.studentindipendenti.it',
|
||||
origin: 'https://visione.studentindipendenti.it',
|
||||
referer: 'https://visione.studentindipendenti.it/'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
css: [
|
||||
'@/assets/css/style.css',
|
||||
|
||||
Reference in New Issue
Block a user