Skip to content

Commit faacae7

Browse files
committed
Compute api endpoint base on window.location.hostname
1 parent 69e8bca commit faacae7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/src/services/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const API_BASE_URL = window.location.hostname.endsWith('.gitpod.dev')
2-
? 'https://3001--01965c3b-370d-7463-845d-125a1daa5fab.eu01.gitpod.dev/api'
2+
? `https://3001--${window.location.hostname.replace(/\d{1,4}--/, '')}/api`
33
: 'http://localhost:3001/api';
44

55
export const fetchMovies = async () => {

0 commit comments

Comments
 (0)