Rmch
Rmch

Reputation: 31

React on remote server

I am working on a React app and trying to find a way to have it served from a local network server while I work on it, instead of localhost:3000. The app files would be in a shared directory on the server so I could work on them from my machine. But when I npm start, the app would be accessible from the LAN and from the outside via the server.

The goal is to avoid having to build/deploy every time someone else needs to have a look at the app (which is often).

Is that even possible ?

Upvotes: 1

Views: 2284

Answers (2)

teddybeard
teddybeard

Reputation: 2014

I suggest using https://ngrok.com/. After you install it, npm start your react app and in another terminal type ngrok http 3000, it will then provide you with external public facing urls anyone can access.

enter image description here

Upvotes: 1

bilwit
bilwit

Reputation: 819

If you're using VS Code you can use the Remote Development Extension Pack to SSH into the local network server and mount the workspace accordingly. You just need to setup the remote host (or subsequent ssh-exposed container) as an SSH server.

Upvotes: 1

Related Questions