Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,17 @@ const nextConfig = {
// (not permanent) so /banner can be repointed at the next event without
// browsers having cached a permanent redirect. Current event:
// AI Engineer World's Fair.
//
// The destination is an absolute URL on purpose. A relative root-path
// destination ('/?utm_...') 500s under our OpenNext/Cloudflare runtime:
// its URL parser treats the empty path segment of '/?...' as the whole
// string and feeds '/?...' to path-to-regexp, which throws "Unexpected
// MODIFIER" on the bare '?'. Using the absolute form routes through the
// external-URL branch, which splits the path and query correctly.
{
source: '/banner',
destination:
'/?utm_source=ai-engineer-worldfair&utm_medium=banner&utm_campaign=ai-engineer-worldfair-2026',
'https://agentrelay.com/?utm_source=ai-engineer-worldfair&utm_medium=banner&utm_campaign=ai-engineer-worldfair-2026',
Comment on lines 62 to +63

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the production domain https://agentrelay.com breaks the redirect during local development (where it will redirect to production instead of localhost) and in preview/staging environments.

To make this robust across all environments, consider dynamically determining the base URL using environment variables (like NEXT_PUBLIC_SITE_URL) and falling back to http://localhost:3000 in development.

Suggested change
destination:
'/?utm_source=ai-engineer-worldfair&utm_medium=banner&utm_campaign=ai-engineer-worldfair-2026',
'https://agentrelay.com/?utm_source=ai-engineer-worldfair&utm_medium=banner&utm_campaign=ai-engineer-worldfair-2026',
destination:
`${process.env.NEXT_PUBLIC_SITE_URL || (process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : 'https://agentrelay.com')}/?utm_source=ai-engineer-worldfair&utm_medium=banner&utm_campaign=ai-engineer-worldfair-2026`,

permanent: false,
},
{ source: '/quickstart', destination: '/docs/quickstart', permanent: true },
Expand Down
Loading