[Solved] How can I configure rest api params (server:port) in my electron app?
Marco last edited by Marco
I’m struggling with my first electron app.
A button triggers a rest api call:
It fails (Network Error) …
Where do I configure my app to use the real url?:
I have had no problems with the spa version.
mKomo last edited by mKomo
Check out the quasar extension dotenv (or the newly released qenv - but I may be mistaken). The way I have this set up is with a dev env and a production env which allows you to use your respective dev or production api.
You can then reference and set your base url in the boot axios file located at
axios.defaults.baseURL = process.env.API;
In my case
process.env.API = "http://localhost:8000/api"
If you’re just looking to set the api url just set
Marco last edited by
Thank you mKomo, it works!
I’m just a newbie.