diff --git a/docker-compose.yml b/docker-compose.yml index 95c16e8..39f731e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: build: ./frontend/. ports: - "127.0.0.1:3500:3000" + environment: + - HOSTNAME volumes: - ./logs/frontend:/app/logs networks: diff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.js index c04f1f3..f738e3d 100644 --- a/frontend/src/lib/api.js +++ b/frontend/src/lib/api.js @@ -1,5 +1,6 @@ const isDev = process.env.NODE_ENV === "development"; -const apiBase = isDev ? 'http://localhost/api' : 'https://mutualify.stanr.info/api'; +const host = process.env.HOSTNAME; +const apiBase = isDev ? 'http://localhost/api' : 'https://'+host+'/api'; export default async function api (endpoint, options) { const response = await fetch(`${apiBase}${endpoint}`, {