ahmedlemine / pdfmerger-frontend

3 stars 0 forks source link

environment variable #2

Open Hiroki-Engineer opened 1 month ago

Hiroki-Engineer commented 1 month ago

@ahmedlemine Thank you for the good educational materials.

I believe we won't be able to communicate with the backend unless we modify VITE_BASE_URL to VITE_HOST_URL. https://github.com/ahmedlemine/pdfmerger-frontend/blob/8ae4e51527ed16d087ab7896c017ced2ab3c349c/.env_example#L1

ahmedlemine commented 1 month ago

Although badly named var, it works fine if you're running both front and backend on your local machine. If they're on different hosts though, you need to update its value to your backend host IP. In my case the backend is running on: 192.168.10.3 port 8000, so I have it like this:

VITE_HOST_URL=http://192.168.10.3:8000

Edit: You're right, it should be --VITE_HOST_URL-- I was referring to .env file which of course is only local to my copy and not included in git. Will fix it.

Hiroki-Engineer commented 1 month ago

@ahmedlemine Thank you for confirming!

ahmedlemine commented 1 month ago

No problem. Just updated README and added steps to run the frontend dev server. Thanks @Hiroki-Engineer