Commit 29343278 authored by Imran Salam's avatar Imran Salam
Browse files

make API_HOST in config protocol agnostic

parent d413b0bd
......@@ -4,4 +4,5 @@ NODE_ENV=development
# Keys for external services
GOOGLE_ANALYTICS_KEY="UA-58710484-17"
API_HOST="ec2-184-73-228-242.compute-1.amazonaws.com"
# Base URL for the API endpoints
API_HOST="//ec2-184-73-228-242.compute-1.amazonaws.com"
......@@ -23,7 +23,7 @@ export const activateBrowser = (browserEl: HTMLDivElement) => {
const activateEvent = new CustomEvent('bpane-activate', {
bubbles: true,
detail: {
'config-url': `http://${config.apiHost}/browser/config`,
'config-url': `${config.apiHost}/browser/config`,
key: 'main'
}
});
......@@ -157,7 +157,7 @@ export const fetchObjectData = (objectId: string) => {
return (dispatch: Dispatch) => {
dispatch(fetchObject.request(objectId));
return fetch(`http://${config.apiHost}/browser/get_object_info/${objectId}`)
return fetch(`${config.apiHost}/browser/get_object_info/${objectId}`)
.then(
(response) => response.json(),
(error) => dispatch(fetchObject.failure(error))
......@@ -175,7 +175,8 @@ export const fetchExampleObjects = createAsyncAction(
export const fetchExampleObjectsData = () => {
return (dispatch: Dispatch) => {
dispatch(fetchExampleObjects.request(null));
return fetch(`http://${config.apiHost}/browser/example_objects`)
return fetch(`${config.apiHost}/browser/example_objects`)
.then(
(response) => response.json(),
(error) => dispatch(fetchExampleObjects.failure(error))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment