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
I have a couple of questions about how server side rendering would work my existing API. How can I run an API under the same port during development? For example, with create-react-app, I would use webpack's proxy configuration. Is there some similar configuration that I can use with next?
Also, in production, how would I run an API and still take advantage of the server side rendering from next?
I'm sure there are simple answers to these questions. I feel like I'm missing some fundamental concepts. Thanks for the help.
The text was updated successfully, but these errors were encountered:
There are discussions about how to allow the usage of custom webpack configurations (#40 and #222), that will allow you to use the webpack's proxy configuration.
Meanwhile you can run your API in another port or made use of NGINX as a reverse proxy to do that (I think the different port is the best for development right now because it doesn't require to configure a NGINX).
In production you can use NGINX as a reverse proxy, so the user made a HTTP request to the NGINX server and it will map the requests to the next.js servers (you can have multiple and load-balance them) or if the request are in /api or api.domain.com (for example) you can map them to your API servers.
I have a couple of questions about how server side rendering would work my existing API. How can I run an API under the same port during development? For example, with create-react-app, I would use webpack's proxy configuration. Is there some similar configuration that I can use with next?
Also, in production, how would I run an API and still take advantage of the server side rendering from next?
I'm sure there are simple answers to these questions. I feel like I'm missing some fundamental concepts. Thanks for the help.
The text was updated successfully, but these errors were encountered: