feat: uwuFinances app with themes, JWT auth and NoCodeBackend sync
This commit is contained in:
31
vite.config.ts
Normal file
31
vite.config.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
react(),
|
||||
tailwindcss(),
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
// Proxy /api/ncb/* → NCB EU Data API (keeps secret key server-side)
|
||||
'/api/ncb': {
|
||||
target: 'https://eu-api.nocodebackend.com',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/ncb/, ''),
|
||||
configure: (proxy) => {
|
||||
proxy.on('proxyReq', (proxyReq) => {
|
||||
proxyReq.setHeader('Authorization', `Bearer ${env.VITE_NCB_SECRET_KEY}`);
|
||||
proxyReq.setHeader('X-Database-Instance', env.VITE_NCB_INSTANCE);
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user