Create React App with an Express Backend

Dave Ceddia · 123K views · 2017 · 5:21

Open on YouTube

Web developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a reference setup when asking how to structure a React and Node/Express project and configure the dev proxy.

Recommended by 0 people across 0 different months, 2018 to 2019.

What it is

A short tutorial from Dave Ceddia showing how to connect a Create React App front end to an Express backend. It centers on the "proxy" setting in package.json so the dev server forwards API calls to the backend, and notes this works with non-Express backends too.

What people said

Cites A.S.J · 2018-01 · Stack Overflow · on “ReactJS front-end with NodeJS backend: Rendering”

thank you very much! Unfortunately, I can't quite follow what was done in this example, so basically you are saying I should do it like it was done here ( [this video] ) rather than here( [LINK] )? Again, thank you very much for your help.

Cites A.S.J · 2018-01 · Stack Overflow · on “ReactJS front-end with NodeJS backend: Rendering”

@trixn I already set up a REST api using node/express, however my problem is that I feel as if I'm not connecting the front-end to the api properly since I added a proxy-key in my package.json file in my client folder (client folder is located in my root directory) and I read that that's only fine for development so I wasn't sure if that was correct. For reference, I structured the whole application kind of like in this video: [this video]

Cites Eric Lima · 2018-05 · Stack Overflow · on “JSON error when using express/node/react”

Anyone know this error? [LINK] "Unhandled Rejection (SyntaxError): Unexpected token P in JSON at position 0... I don't know how an error message can get any more vague. I also followed a guide which apparently has worked for many people but for whatever reason I run into this error... This is the guide I followed verbatim. [this video] And I also followed other guides that are the same thing But I keep running into this weird error message when it's time to display. I'm guessing I have a weird version of node or something?

Cites Machine Learning · 2019-10 · Stack Overflow · on “React | Package.Json | "proxy" Not Working in Google App Engine”

I created a basic React app with 'create-react-app' and a simple Express service. In the react application I added 'proxy' to the Package.json file which points to the Express service url. "proxy": <EXPRESS URL HERE> When testing locally React calls Express through the proxy and everything works. When I deploy to Google App Engine the proxy isn't working. I tested Express service(on App Engine) with my local React instance and things work as expected. When I deploy the React app to App Engine(after running NPM RUN BUILD), the proxy is not working. Video i watched on getting React/Express working together with 'proxy': [this video]