- Like any other frontend library (jQuery, etc), it is happy to be served by any old webserver – Apache, NGINX – or any kind of backend – PHP, Rails, and so on.
- Lest we lose track of how the Internet works, here’s a diagram to anchor the discussion:
- I said that React doesn’t care what your server is doing, which is true…
But if you add React Router to your project, and you want to use its feature, the server must serve up your page no matter which URL the user accesses.
- Though if your backend is not Node.js, you’ll probably want the last step of your build to be “copy the built files to my server’s root directory.”
- Alternatively, you could set up Webpack to serve your React app and then proxy all other requests to your real backend server (whether that’s local, or across the web somewhere).
Can you use React with a PHP, Java, Rails, or other kind of backend?
Continue reading “Do I need Node.js in the backend?”