diff --git a/apiserver/apiserver/settings.py b/apiserver/apiserver/settings.py index 23b1b6c..60d08c0 100644 --- a/apiserver/apiserver/settings.py +++ b/apiserver/apiserver/settings.py @@ -34,6 +34,7 @@ ALLOWED_HOSTS = [] if DEBUG: ALLOWED_HOSTS += [ 'spaceport-api.dns.t0.vc', + 'api.spaceport.dns.t0.vc', ] diff --git a/webclient/src/utils.js b/webclient/src/utils.js index 54e0841..254b454 100644 --- a/webclient/src/utils.js +++ b/webclient/src/utils.js @@ -1,16 +1,6 @@ -var siteUrl, apiUrl, staticUrl; - -if (process.env.NODE_ENV !== 'production') { - siteUrl = 'http://spaceport.dns.t0.vc'; - apiUrl = 'http://spaceport-api.dns.t0.vc'; - staticUrl = 'http://spaceport-static.dns.t0.vc'; -} else { - siteUrl = 'https://' + window.location.hostname; - apiUrl = 'https://api.' + window.location.hostname; - staticUrl = 'https://static.' + window.location.hostname; -} - -export { siteUrl, apiUrl, staticUrl }; +export const siteUrl = window.location.protocol + '//' + window.location.hostname; +export const apiUrl = window.location.protocol + '//api.' + window.location.hostname; +export const staticUrl = window.location.protocol + '//static.' + window.location.hostname; export const requester = (route, method, token, data) => { let options = {headers: {}};