Files
carmanagement/apps/admin/next.config.js
T
2026-05-16 16:51:59 -04:00

33 lines
788 B
JavaScript

/** @type {import('next').NextConfig} */
const apiOrigin = (process.env.API_INTERNAL_URL ?? process.env.API_URL ?? 'http://localhost:4000').replace(/\/api\/v1\/?$/, '')
const apiUrl = new URL(apiOrigin)
const nextConfig = {
basePath: '/admin',
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'res.cloudinary.com',
},
{
protocol: apiUrl.protocol.replace(':', ''),
hostname: apiUrl.hostname,
...(apiUrl.port ? { port: apiUrl.port } : {}),
pathname: '/storage/**',
},
],
},
transpilePackages: ['@rentaldrivego/types'],
async rewrites() {
return [
{
source: '/api/:path*',
destination: `${apiOrigin}/api/:path*`,
},
]
},
}
module.exports = nextConfig