Skip to content

How to upload a React SPA (Nginx) #149833

Closed Answered by viniciusvts
Chilicode2 asked this question in npm
Discussion options

You must be logged in to vote

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

Replies: 1 comment 2 replies

Comment options

@viniciusvts
Comment options

Answer selected by Chilicode2
@viniciusvts
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
npm
Labels
None yet
2 participants