Make create-react-app available to computers outside of local network - node.js

I was hoping to run my react-app and make it accessible to computers outside of my local network. I want someone to be able to type in :3000 (or other secure port) and be able to see my application. Is this possible without using a hosting service like Netlify? Obviously there are security concerns but this is primarily for out of network testing for a video player I'm creating.
Thank you.

Simply run HOST=0.0.0.0 npm run start.
Afterwards open the url from another device on the network.
Find whatever your ip is through ipconfig on cmd in windows and then
for e.g
replace this ip with what your ip is:
192.153.23.10:3000 would work.
Further read : Docs
there is also a great service called Ngrokwhich can assign https secure address to localhost apps. I know how to make it work with express and next js but there would be something for you there too check it out.

Related

Deploy React website with node.js backend

I have developed website in react and node.js as intermediary to send and receive response.
Now i want to put this on a machine in lab , so everyone can access it.
Can i Install node on machine in lab and run same setup as on my dev machine and give ip of that server?
I tried searching deployment with node js an react, but everyone using AWS, or some external server after npm build.
How do I deploy my react app on lab machine with out actually copying code?
Two Things before you share your IP and PORT:
Have a process monitor setup in your lab machine, Check out pm2. This will help you run your application in the background,
monitor your application and start your application after restart.
Enable port in your firewall for everyone to use. if your lab system is Ubuntu then allow ufw for the port.
Now you can share your IP:PORT and everyone would be able to access it, provided they all are connected to the same network.
If you want everybody access your server, you can share your private IP with them, so others can access it using
yourip:port

Hosting Nodejs app

I am running an app on localhost:3000, and now I am looking to host it using my home network.
I am running on windows machine, I have looked at number of guides but none seem to be complete enough.
Any help is much appreciated.
when you run your app in localhost:3000, you app in that moment is in online , in your private network... if you wanna check your app from outside pc.
you will need this point.
1- check the principal adress pc, the ip
2- you computer, shut down your firewall,, some times block you app.
3- in your second computer, connect in the same wifi, and put adress in a
browser and port, and you will saw you app online
EXAMPLE NO REAL
change ww.example.com by 1.63.21.0:3000
to keep you app, all the time running, when you app is finished, you will need this comand.
forever start app.js
that means, all the time of you computer is turn on, you app will start, to give a service, in this case your app
reference
https://github.com/foreverjs/forever
if you really wanna build a server, and put your pc in the internet world, you will need configurate you modem and buy some adress.. like a host in internet, a domain, hope help you with this message
I'd recommend using a service like Heroku instead of your home network, it has way better uptime, and you only have to worry about the code in your app instead of the networking and system architecture.

Assuming nodejs-based webapp runs locally on the encrypted wifi, can it still be hacked outside the wifi?

If you choose to not deploy your webapp outside your Wifi, simply run nodejs server locally, and access it via [ip-address/alias]:[port], can hackers still access it remotely outside its WiFi?
A hacker would have to gain access to your local network from the outside, which is difficult but possible. Check for open ports on your router. Use WPA2 and disable WPS. If your node app manages critical data, consider password-protecting it, even if you're not going to put it online.

Setting up a web server for access outside of subnetwork (Node.js, Nginx maybe, Ubuntu server)

A little bit of context. I have developped a webapp on node.js (and a glamourous set of extensions). It has been approved for testing with true users at my company and i am supposed to deploy it now. Problem is that basically i have no idea unto how attack this problem. I have so many questions.
For the moment i have created a virtual machine on the local server. I have installed ubuntu server unto it and i have the intuition about how to deploy the app in this part (i suppose following the same steps as when i started to work on this project). I do not know however if i can have remote access from the outside of my network to this virtual machine. I also dont know if additional configuration in ubuntu's side is needed to make such an idea work (for example: in the installation there was a part about proxies that at the moment i decided to ignore)
From the few documents i have read about it since i was assigned this, a solution may lie in using nginx. The logic behind it if i am not mistaken (and please correct me if i am) is that nginx can help linking the HTTP requests (through the port 80 which is normally opened for access in most machines) and link it to a specific port on the machine (The sexy app i have developped).
In a more early stage, what ressources would i need to start this off? Would i need a domain name? IS it necessary? Do i need a different virtual server to link the apps or can they be on the same machine?
If you have additional comments or tips for someone that is learning to do this kind of thing, please do.
For remote access, you will need a couple of things. First of all, you will need to make sure that your virtual machine is on a bridged adapter. I'm not sure what virtual machine you are on, or I'd give you more detail on how to do this. Second, you will need to make sure that your router has port 80 (or whatever port you chose to use) setup via port forwarding so that requests coming in map to the server (a request comes to the router on the port, the router must then know where to send those requests to). Finally, if you want to use a port other than port 80, you should be able to configure this in the nodejs configuration. This may also be configurable in the router so that requests coming in on port 80 are mapped to, say 8080, but, given that this is a company, it's probably easier to reconfigure the nodejs server than have it set up special mapping.
This experience comes from personal experience with hosting web servers at home. Corporate routers should need similar configuration unless each system has a public IP address on the internet, which is unlikely.

Put node app online privately so my team can preview it before launch?

I'm building a Node app and need to put it online so my team can access it. We are concerned about the content of the app leaking and need some security.
Is a VPN the best way? Could I set one up easily on Digital Ocean or elsewhere? I have only set up a VPN for tunnelling before, and don't have a local computer or server that is always on.
I first thought about putting it on a randomly generated subdomain on my regular domain, or controlling it with .htaccess and password, but I'm not sure if this is doable with Node.
EDIT: what about just setting up with pptp and then editing the hosts file to point my-temporary-domain.com to localhost?
This problem is relevant because you don't have a local area network that your team all has access to. The way I've solved this in the past is to set up your application listening on the 127.0.0.1 on a server that is accessible to the internet. Allow your team to have SSH access, and set it up so they forward localhost and port 80 on their local machine to whatever port your application is listening on. You can do this with openssh and putty.

Resources