ngrok is a cross-platform application that enables developers to expose a local development server to the Internet with minimal effort. The software makes your locally-hosted web server appear to be hosted on a subdomain of ngrok.com, meaning that no public IP or domain name on the local machine is needed.
Here, we are discussing how to publish your local site or API project using ngrok. When you use ngrok you do not need any type of server or paid software.
Step1: Goto ngrok portal from Here
Now click on the “Get Started for Free” button and sign up
After sign up, you will redirect to the dashboard of ngrock and it looks like :
Now download ngrok application and copy the “Connect your account” Command from your portal
Step:2 Now run your project
Step:3 Now open your ngrok application and it’s look lite this :
Step:4 Now enter the command which is you copied from ngrok portal and press enter
Step: 5 Next we have two commands :
1.//For API MVC,angular,core etc ngrok http https://localhost:[Your Localhost port] -host-header="localhost:[Your Localhost port]" 2.//For normal html template ngrok http -host-header=rewrite localhost:[Your Localhost port]
Note: When you are going to host any API, MVC project, angular, core project you need to use the first command, and when you want to host normal HTML, CSS, js templates you need to use the second one.
Don’t forget to replace your host PORT in command.
here we are going to host on normal MVC crud project.
Follow the below video :
If your first URL is not working you can use your second URL as well