fix: ajout des urls prod et demo

This commit is contained in:
N3WT DE COMPET
2025-06-01 13:21:14 +02:00
parent 6bc24055cd
commit 043d93dcc4

View File

@ -5,9 +5,6 @@ const pkg = require('./package.json');
const withNextIntl = createNextIntlPlugin();
const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080';
const apiUrlObj = new URL(apiUrl);
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
@ -22,9 +19,17 @@ const nextConfig = {
hostname: 'www.gravatar.com',
},
{
protocol: apiUrlObj.protocol.replace(':', ''),
hostname: apiUrlObj.hostname,
...(apiUrlObj.port ? { port: apiUrlObj.port } : {}),
protocol: 'https',
hostname: 'api.demo.n3wtschool.com',
},
{
protocol: 'https',
hostname: 'api.prod.n3wtschool.com',
},
{
protocol: 'http',
hostname: 'localhost',
port: '8080',
},
],
},