- Add Next.js rewrites to proxy API calls through same origin (fixes login/media on werkout.treytartt.com) - Fix mediaUrl() in DayCard and ExerciseRow to use relative paths in production - Add proxyTimeout for long-running workout generation endpoints - Add CSRF trusted origin for treytartt.com - Split docker-compose into production (Unraid) and dev configs - Show display_name and descriptions on workout type cards - Generator: rules engine improvements, movement enforcement, exercise selector updates - Add new test files for rules drift, workout research generation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
// v2
|
|
const nextConfig = {
|
|
skipTrailingSlashRedirect: true,
|
|
experimental: {
|
|
proxyTimeout: 120000, // 2 minutes for long-running workout generation
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: "http",
|
|
hostname: "localhost",
|
|
port: "8000",
|
|
},
|
|
{
|
|
protocol: "http",
|
|
hostname: "0.0.0.0",
|
|
port: "8000",
|
|
},
|
|
],
|
|
},
|
|
async rewrites() {
|
|
const djangoUrl = process.env.DJANGO_INTERNAL_URL || "http://localhost:8000";
|
|
// Helper: for each Django prefix, create two rewrites:
|
|
// 1. with trailing slash preserved
|
|
// 2. without trailing slash → add it (Django requires trailing slashes)
|
|
const djangoPrefixes = [
|
|
"media", "registered_user", "exercise", "muscle",
|
|
"equipment", "workout", "generator", "videos", "admin",
|
|
];
|
|
return djangoPrefixes.flatMap((prefix) => [
|
|
{
|
|
source: `/${prefix}/:path*/`,
|
|
destination: `${djangoUrl}/${prefix}/:path*/`,
|
|
},
|
|
{
|
|
source: `/${prefix}/:path*`,
|
|
destination: `${djangoUrl}/${prefix}/:path*/`,
|
|
},
|
|
]);
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|