Hry there I'm building an application with React on the client side and expressJS on the server side. I'm kinda new to react and have some question about it -
Let say your React App starts. So you have a standalone application run in the browser. Your backend should only send data to your front end. It should not interfere directly into the front end! Your frontend reacts independently according to the data it gets from the backend.
So if a user wants to access content to which he has no authorization, the backend should return the status code 401. Your frontend should evaluate this response and show the user a suitable message.
You should look at your frontend and baking separately from each other. Your backend can deliver your frontend to the browser and provide an API for its queries. But it does not have to be mandatory.
You can write a twitter app with react. So your backend would only deliver your static files (your react app). All inquiries of your front end would go to the twitter api.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.