fix: replace hardcoded backend URL with environment variable for consistency

This commit is contained in:
Marco Pedone 2025-10-17 19:24:30 +02:00
parent 727f1e760c
commit c3b2c10bdf

View file

@ -5,8 +5,6 @@
import { env } from "node:process";
const backendUrl = "http://localhost:1323";
/** @type {import("next").NextConfig} */
const nextConfig = {
compiler: {
@ -48,7 +46,7 @@ const nextConfig = {
protocol: "https",
},
{
hostname: backendUrl,
hostname: `${env.BACKENDSERVER_URL}`,
},
],
},
@ -61,11 +59,11 @@ const nextConfig = {
source: "/api/panel",
},
{
destination: `${backendUrl}/images/get/:slug*`,
destination: `${env.BACKENDSERVER_URL}/images/get/:slug*`,
source: "/go-api/images/get/:slug*",
},
{
destination: `${backendUrl}/storage/get/:slug*`,
destination: `${env.BACKENDSERVER_URL}/storage/get/:slug*`,
has: [
{ key: "access_token", type: "cookie" },
{
@ -78,7 +76,7 @@ const nextConfig = {
source: "/go-api/storage/get/:slug*",
},
{
destination: `${backendUrl}/storage/upload:slug*`,
destination: `${env.BACKENDSERVER_URL}/storage/upload:slug*`,
has: [
{ key: "access_token", type: "cookie" },
{