LBlend / mann-eller-kvinne

🤵 En nettside som bruker maskinlæring til å gjette om du er mann eller kvinne basert på hva du skriver 💃
https://mannellerkvinne.lblend.moe
GNU General Public License v3.0
1 stars 0 forks source link

Find a proper way to set dev api-url #11

Closed marksverdhei closed 3 years ago

marksverdhei commented 3 years ago

The current soultion requires changing a line of code each time you want to switch it. We should have a .env config or something similar to set react environment variables when switching between dev and build. It might require installing additional dependencies (E.g. webpack or dotenv)

This article describes a couple ways of doing it: https://trekinbami.medium.com/using-environment-variables-in-react-6b0a99d83cf5

LBlend commented 3 years ago

Due to CORS I suggest we also add environment variables to the backend. In order for the backend to accept requests from the frontend, the frontend url needs to be set in the code (here)

I will take a look at some potential solutions to this.