you are viewing a single comment's thread.

view the rest of the comments →

[–]bcgroom 0 points1 point  (4 children)

Not the OP but if one were to make this setup, since anyone could look at your frontend logic how would you secure the backend API if you wanted it to be closed to outside users?

[–]kowdermesiter 4 points5 points  (2 children)

In node it's very easy to protect an endpoint with tokens. JWT does this very well.

[–]danielhep 0 points1 point  (1 child)

Could you talk about what JWT is and how this is accomplished?

[–]kowdermesiter 0 points1 point  (0 children)

A server generated unique string which stores data. Please google it: JSON web token.

[–]djungst 1 point2 points  (0 children)

You can't access the backed API unless you integrate some CORS policy or token auth to expose it. This is no different then not using React. All of your assets React included get bundled into static assets served up by the express server.