34 lines
938 B
JavaScript
34 lines
938 B
JavaScript
|
|
/**
|
||
|
|
* =============================================================================
|
||
|
|
* NEXT.JS CONFIGURATION
|
||
|
|
* =============================================================================
|
||
|
|
*
|
||
|
|
* This configures the Next.js build and runtime behavior.
|
||
|
|
*
|
||
|
|
* Key features:
|
||
|
|
* - API rewrites to proxy requests to FastAPI backend (avoids CORS issues)
|
||
|
|
* - Image optimization settings
|
||
|
|
* - Environment variables handling
|
||
|
|
*/
|
||
|
|
|
||
|
|
/** @type {import('next').NextConfig} */
|
||
|
|
const nextConfig = {
|
||
|
|
// Rewrites let us proxy API calls to the FastAPI backend
|
||
|
|
// This avoids CORS issues during development
|
||
|
|
async rewrites() {
|
||
|
|
return [
|
||
|
|
{
|
||
|
|
source: "/api/backend/:path*",
|
||
|
|
destination: "http://localhost:8000/api/:path*", // FastAPI backend
|
||
|
|
},
|
||
|
|
];
|
||
|
|
},
|
||
|
|
|
||
|
|
// Image optimization - add domains you'll load images from
|
||
|
|
images: {
|
||
|
|
domains: ["your-supabase-project.supabase.co"],
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
module.exports = nextConfig;
|