2
votes

I am very new at this and I am following this tutorial (https://hackernoon.com/start-to-finish-deploying-a-react-app-on-digitalocean-bcfae9e6d01b) to practice deploying my standard created app via create-react-app in digitalocean.

While running [pm2 serve build] it shows:

pm2 serve build
[PM2] Applying action restartProcessId on app [static-page-server-8080](ids: 0)
[PM2] [static-page-server-8080](0) ✓
[PM2] Process successfully started
[PM2] Serving /home/carles/build on port 8080

But it nothing to see on the mentioned port. This is what I get when running [pm2 list]:

App name                 id  version  mode  pid  status   restart  uptime  cpu  mem     user    watching 
├─────────────────────────┼────┼─────────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────┼────────┼──────────┤
 static-page-server-8080  0   3.3.1    fork  N/A  errored  0        0       0%   0 B     carles  disabled 

All worked fine until this point #3 of the tutorial. Any Idea how to make this work? I appreciate your help! Thanks!!

1

1 Answers

1
votes

I recommend you follow these instructions: server-react-app

But, before of run your aplication in a server, do you need built it, running:

yarn build

or

npm run build

When the build is completed, it will create a folder with name build , then, do you will need inform to your server run in build folder. Then

  1. Run yarn build or npm run build

  2. npm install -g serve

  3. pm2 serve build

  4. Access it: http://someip:8080

In this case it will run your application from build and with port 8080. With this your application will works.