-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
29 lines (26 loc) · 825 Bytes
/
next.config.js
File metadata and controls
29 lines (26 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const createNextIntlPlugin = require('next-intl/plugin');
const withNextIntl = createNextIntlPlugin('./i18n/request.ts');
const externalApiBaseUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5005/api';
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
// Keep Better Auth routes handled by this app.
{
source: '/api/auth/:path*',
destination: '/api/auth/:path*',
},
// Keep oRPC routes handled by this app.
{
source: '/api/orpc/:path*',
destination: '/api/orpc/:path*',
},
// Proxy remaining API routes to the configured backend API.
{
source: '/api/:path*',
destination: `${externalApiBaseUrl}/:path*`,
},
]
},
}
module.exports = withNextIntl(nextConfig);