serve React build locally

Viewed 18

I am currently learning React, to eventually pair with Ruby on Rails.

I am following the tutorial: https://www.youtube.com/watch?v=w7ejDZ8SWv8 to get a handle on the language.

I have successfully compiled the build folder, running the command $ npm run build

I have also run the command $ sudo npm i -g serve in my terminal to install the npm serve

when running the build on localhost:8000, using the command $ serve - s -p 8000 in the terminal, it is serving using WEBrick::HTTPServer, throwing the following up in the terminal:

[2022-09-12 15:03:22] INFO  WEBrick 1.7.0
[2022-09-12 15:03:22] INFO  ruby 3.0.0 (2020-12-25) [x86_64-darwin19]
[2022-09-12 15:03:22] INFO  WEBrick::HTTPServer#start: pid=5412 port=8000

which results in localhost:8000 showing:

localhost:8000

My question: Is there a way of altering this so I can serve my react build successfully, without causing issues when I go back to serving my RoR applications later?

0 Answers
Related