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 4296e52d3b
commit 3b8497698f
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -5,7 +5,7 @@
* *
* Example: framameet.org * 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 * 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 * 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 * 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 * 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`;