diff --git a/Front-End/next.config.mjs b/Front-End/next.config.mjs index 095c420..cc678bb 100644 --- a/Front-End/next.config.mjs +++ b/Front-End/next.config.mjs @@ -5,6 +5,9 @@ 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', @@ -19,9 +22,9 @@ const nextConfig = { hostname: 'www.gravatar.com', }, { - protocol: 'http', - hostname: 'localhost', - port: '8080', + protocol: apiUrlObj.protocol.replace(':', ''), + hostname: apiUrlObj.hostname, + ...(apiUrlObj.port ? { port: apiUrlObj.port } : {}), }, ], }, diff --git a/Front-End/src/components/ProfileSelector.js b/Front-End/src/components/ProfileSelector.js index 761368a..25fde35 100644 --- a/Front-End/src/components/ProfileSelector.js +++ b/Front-End/src/components/ProfileSelector.js @@ -128,22 +128,20 @@ const ProfileSelector = ({ onRoleChange, className = '' }) => {