fix(rooms): Use rewrite for /api/city/rooms instead of API route
- Removed API route that was conflicting with rewrite - Added explicit rewrite for /api/city/rooms -> /api/v1/city/rooms - Rewrite order matters: specific routes before wildcard
This commit is contained in:
@@ -41,12 +41,18 @@ const nextConfig: NextConfig = {
|
||||
source: '/api/public/:path*',
|
||||
destination: `${internalApiUrl}/public/:path*`,
|
||||
},
|
||||
// City Rooms API (list) -> /api/v1/city/rooms
|
||||
// Note: This must be before /api/city/:path* to take precedence
|
||||
{
|
||||
source: '/api/city/rooms',
|
||||
destination: `${internalApiUrl}/api/v1/city/rooms`,
|
||||
},
|
||||
// City Rooms API (specific slug endpoint) -> /api/v1/city/rooms
|
||||
{
|
||||
source: '/api/city/rooms/:slug',
|
||||
destination: `${internalApiUrl}/api/v1/city/rooms/:slug`,
|
||||
},
|
||||
// City API -> /city
|
||||
// City API -> /city (excludes /api/city/rooms which is handled above)
|
||||
{
|
||||
source: '/api/city/:path*',
|
||||
destination: `${internalApiUrl}/city/:path*`,
|
||||
|
||||
Reference in New Issue
Block a user