Question
How to deploy a create-react-SSR-app to a droplet?
Hi all,
Quite a beginner here so I hope my questions aren’t too stupid.
I’m looking to improve my web developer skills so I’ve been going from simple html/css to javascript to react etc… and now I’m looking into server side rendering.
First time using digital ocean, I’ve setup a droplet and followed the steps described in this tutorial: https://coderrocketfuel.com/article/deploy-a-create-react-app-website-to-digitalocean
Great stuff, was excited when I was seeing that spinning react logo. Then I thought I would go a step further and set up a ssr version of it. For my ease of use, I’ve been using the handy create-react-ssr-app to do so. When creating the production build, it gives me a build folder containing two files:
- server.js
- public (folder) (contains all the basics of a react app with static, app.html etc)
And of course, just copying those files into the nginx html folder does not do the trick, I’m guessing I need to edit the nginx/sites-available/default file so the server goes to the right place? Hope the question is clear enough, essentially, I followed the deploy tutorial, and now would like to do exactly the same but with an ssr react app.
All help is welcome :)
Cheers.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×