Skip to content

Commit 69e8bca

Browse files
committed
Fix api endpoint
1 parent 2ff2400 commit 69e8bca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frontend/src/services/api.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const API_BASE_URL = 'http://localhost:3001/api';
1+
const API_BASE_URL = window.location.hostname.endsWith('.gitpod.dev')
2+
? 'https://3001--01965c3b-370d-7463-845d-125a1daa5fab.eu01.gitpod.dev/api'
3+
: 'http://localhost:3001/api';
24

35
export const fetchMovies = async () => {
46
try {
@@ -12,4 +14,4 @@ export const fetchMovies = async () => {
1214
console.error('Error fetching movies:', error);
1315
throw error;
1416
}
15-
};
17+
};

0 commit comments

Comments
 (0)