How to share your app online
You want to share your app online for purpose of testing or to show it to someone? I will show you 2 easy ways to do it.
ngrok allows you to expose a web server running on your local machine to the internet. Just tell ngrok what port your web server is listening on.
This means that you can use your own computer as a server that will enable you to "open" your project to the world.
Setting ngrok up is really easy and simple
- First you need to download ngrok from here. Just choose your OS and download will start.
- Then you need to go into the directory where you downloaded it and type into terminal
ngrok http 8080. After a few seconds, you will get this into a terminal
- You will then use those URLs that are provided (either http:// or https://) and open it on another device or send it to someone.
- Now you or the person you gave it to will be able to see your app
NOTE! You should never use ngrok for production e.g. when you want your app to be fully online. ngrok is not made for that. You should use it only in development. You can read more about ngrok here.
This method is easier and with less setup than ngrok (if that is even possible )
First, you need to check if you have SSH installed on your system
- Open up the terminal and type SSH. If you get anything but
command not found. You are good to go
- If you get
command not foundor some similar message you probably need to install SSH on your system. It is pretty easy to install. Just search how to install it for your OS
- If you get
- Make sure you start your app on port 8080
ssh -R 80:localhost:8080 ssh.localhost.runin your terminal
After a few seconds, you will get this
If you see that screen you are good to go. All you need to do now is to copy the
*.localhost.run link that is
printed in the terminal and share it with whomever you want.
NOTE! You should never use SSH for production e.g. when you want your app to be fully online as this is not the right method to do it.