How to upload a React SPA (Nginx) #149833
-
*Woops |
Beta Was this translation helpful? Give feedback.
Answered by
viniciusvts
Jan 24, 2025
Replies: 1 comment 2 replies
-
it will be like:
Learn more:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or maybe you are putting the source code in your server.
But you need to compile your project into a production build files.
The react documentation: https://create-react-app.dev/docs/deployment/
"npm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main.<hash>.js are served with the contents of the /static/js/main.<hash>.js file."
Documentation for "Creating a Production Build":
https://create-react-app.dev/docs/production-build