Don't use compile-time defined URLs, just use window.location

This allows to use a single front-end on two different instances, and
will allow us redistribute the front-end as Elixir releases

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-08-05 10:39:40 +02:00
parent 41ae49e3e3
commit ddac0aee65

View File

@ -5,7 +5,7 @@
*
* Example: framameet.org
*/
export const MOBILIZON_INSTANCE_HOST = process.env.MOBILIZON_INSTANCE_HOST;
export const MOBILIZON_INSTANCE_HOST = window.location.hostname;
/**
* URL on which the API is. "/api" will be added at the end
@ -14,7 +14,7 @@ export const MOBILIZON_INSTANCE_HOST = process.env.MOBILIZON_INSTANCE_HOST;
*
* Example: https://framameet.org
*/
export const GRAPHQL_API_ENDPOINT = process.env.GRAPHQL_API_ENDPOINT;
export const GRAPHQL_API_ENDPOINT = window.location.origin;
/**
* URL with path on which the API is. Replaces GRAPHQL_API_ENDPOINT if used
@ -23,4 +23,4 @@ export const GRAPHQL_API_ENDPOINT = process.env.GRAPHQL_API_ENDPOINT;
*
* Example: https://framameet.org/api
*/
export const GRAPHQL_API_FULL_PATH = process.env.GRAPHQL_API_FULL_PATH;
export const GRAPHQL_API_FULL_PATH = `${window.location.origin}/api`;