Spaces:
Paused
Paused
Download frontend/next.config.js from data-llm-hub/tensorwall: direct link, hf CLI and curl.
- Browser
- Download file 966 Bytes
-
https://huggingface.co/spaces/data-llm-hub/tensorwall/resolve/main/frontend/next.config.js
- Command line
-
hf download hf://spaces/data-llm-hub/tensorwall/frontend/next.config.js
-
curl -L -o next.config.js https://huggingface.co/spaces/data-llm-hub/tensorwall/resolve/main/frontend/next.config.js
966 Bytes
| /** @type {import('next').NextConfig} */ | |
| const nextConfig = { | |
| // Production: API calls go directly to backend | |
| // Development: Proxy to local backend | |
| async rewrites() { | |
| // In production, don't rewrite - frontend calls API directly | |
| if (process.env.NODE_ENV === 'production') { | |
| return [] | |
| } | |
| // Development proxy | |
| return [ | |
| { | |
| source: '/api/:path*', | |
| destination: `${process.env.BACKEND_URL || 'http://localhost:8000'}/:path*`, | |
| }, | |
| ] | |
| }, | |
| // Security headers | |
| async headers() { | |
| return [ | |
| { | |
| source: '/:path*', | |
| headers: [ | |
| { key: 'X-DNS-Prefetch-Control', value: 'on' }, | |
| { key: 'X-Content-Type-Options', value: 'nosniff' }, | |
| // Allow embedding in HuggingFace Spaces iframe | |
| { key: 'Content-Security-Policy', value: "frame-ancestors 'self' https://huggingface.co https://*.hf.space" }, | |
| ], | |
| }, | |
| ] | |
| }, | |
| } | |
| module.exports = nextConfig | |