DEV Community


Discussion on: Using Create-React-App with Express

loujaybee profile image
Lou — Cloud Engineer Author • Edited

Hey Sammy!

All of the requests are for absolute paths. So for the ping example would just be:


Then node works out to send it to the right place. This maps the create react app on port 3000 to the api requests on 8080.

If you want them on a separate server you'll need to call with the port number, or domain that you setup your api server on.

Like so:


With that option, however you'll neeed to fiddle with your API access control. So that you only allow access to your app, not the whole internet. However, this can be more tricky and fiddly and depends a lot on how you setup your architecture.