Configuration

This commit is contained in:
2024-07-07 11:33:59 +04:00
parent de7f3ec141
commit 37ddc4b4ab
8 changed files with 99 additions and 65 deletions

View File

@@ -1,21 +1,20 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return process.env.NODE_ENV == "development"
? [
{
source: "/api/:path*",
destination: "http://127.0.0.1:8000/:path*",
},
]
: [];
return [
{
source: "/api/:path*",
destination: `${process.env.BACKEND_PROTOCOL}://`+
`${process.env.BACKEND_DOMAIN}:${process.env.BACKEND_PORT}/:path*`,
}
]
},
images: {
remotePatterns: [
{
protocol: "http",
hostname: "127.0.0.1",
port: "8000",
protocol: process.env.BASE_PROTOCOL,
hostname: process.env.BASE_DOMAIN,
port: process.env.BASE_PORT,
},
],
},