feat(frontend): added CNB API and moved management into a new tab

This commit is contained in:
ribardej
2025-10-30 12:30:35 +01:00
parent c74462b82f
commit 4a8edf6eb8
3 changed files with 146 additions and 62 deletions

View File

@@ -3,5 +3,22 @@ import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react()],
server: {
proxy: {
// We'll proxy any request that starts with '/api-cnb'
'/api-cnb': {
// This is the real API server we want to talk to
target: 'https://api.cnb.cz',
// This is crucial: it changes the 'Origin' header
// to match the target, so the CNB server is happy.
changeOrigin: true,
// This rewrites the request path. It removes the '/api-cnb' part
// so the CNB server gets the correct path ('/cnbapi/exrates/daily...').
rewrite: (path) => path.replace(/^\/api-cnb/, ''),
},
},
},
})