Create setup switch for local dev setup and deployed setup #327
Labels
Discussion
Thinks that need to be discussed
operations
consists of all issues that regard application building and hosting
Currently we root the backend requests in the apollo client dependent on the environment variable
NEXT_PUBLIC_DEV
:This could lead to problems when deploying the software on the production service because
https://api.test-pledge4future.heigit.org/graphql/
will then no longer be the valid url for the backend.To overcome this problem, I suggest to remove the
NEXT_PUBLIC_DEV
environment variable and introduce a new one called 'NEXT_PUBLIC_INSTANCE`. We can then specify a string for this variable that specifies, wether the application is hosted in a local dev setup, in the test instance or the production instance.We define three valid strings:
p4f-local
,p4f-test
andp4f-prod
. With these values, we can then get the following constellations with the resulting API url defined by a function that looks like this:The text was updated successfully, but these errors were encountered: