Skip to content

Commit

Permalink
Use envvar host
Browse files Browse the repository at this point in the history
  • Loading branch information
stanriders committed Oct 18, 2023
1 parent a175ce9 commit 9b3e02e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ services:
build: ./frontend/.
ports:
- "127.0.0.1:3500:3000"
environment:
- HOSTNAME
volumes:
- ./logs/frontend:/app/logs
networks:
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lib/api.js
Original file line number Diff line number Diff line change
@@ -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}`, {
Expand Down

0 comments on commit 9b3e02e

Please sign in to comment.