- next.config: development-only rewrite /api/:path* to 127.0.0.1:4000; move sharp to experimental.serverComponentsExternalPackages for Next 14 - media/[id]/route: resolve storage at request time, fallbacks for backend/storage/media vs storage/media, async params, force-dynamic Made-with: Cursor
26 lines
563 B
JavaScript
26 lines
563 B
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
experimental: {
|
|
serverComponentsExternalPackages: ['sharp'],
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{ protocol: 'https', hostname: '**' },
|
|
],
|
|
},
|
|
async rewrites() {
|
|
const rules = [
|
|
{ source: '/calendar.ics', destination: '/calendar' },
|
|
];
|
|
if (process.env.NODE_ENV === 'development') {
|
|
rules.push({
|
|
source: '/api/:path*',
|
|
destination: 'http://127.0.0.1:4000/api/:path*',
|
|
});
|
|
}
|
|
return rules;
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|