You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application will call localhost:3000/api/users/login
This configuration is kinda smelly for production, I feel it cand be done more correctly, and I've been trying to find what is the proper configuration to put both projects together.
I was wondering what is the correct configuration for this, if I can put everything in one project (how) or should I use two like now.
In the case of using two, ¿What is the best way of making the api calls? And how do I deploy it? my hosting provider is telling me to upload the backend as the root project and then put the entire frontend in the public folder of the backend project, but I don't like that so much either.
The text was updated successfully, but these errors were encountered:
I usually use a reverse proxy like nginx in production to redirect HTTP/HTTPS properly to my backend and client. If your "Hosting Provider" doesn't support some kind of reverse proxing for your apps, I don't think there is much you can do but setup them separated.
I put this question on stackoverflow, but there is no-movement at all there... so putting it here also.
I have a project made with dvajs using dva-cli. All my frontend is there, together with roadhogjs just like dva-cli installs.
Then I have a backend project made with a typical express and nodejs configuration. This backend has no webpages, only api calls using the port 3000.
The frontend has a proxy in the webpack config to bypass roadhog mock to localhost:3000 to make the calls to the backend instead of using the mock:
So when I make a call like:
The application will call
localhost:3000/api/users/login
This configuration is kinda smelly for production, I feel it cand be done more correctly, and I've been trying to find what is the proper configuration to put both projects together.
I was wondering what is the correct configuration for this, if I can put everything in one project (how) or should I use two like now.
In the case of using two, ¿What is the best way of making the api calls? And how do I deploy it? my hosting provider is telling me to upload the backend as the root project and then put the entire frontend in the public folder of the backend project, but I don't like that so much either.
The text was updated successfully, but these errors were encountered: