Before deploying the web-app to production, it's always a good practice to test it on different devices.
Like, Test the responsiveness of your web-app on mobile.
So for this, we need a public-url, So that we can access that web-app from our mobile-phone.
To solve above problem, we have 'ngrok'
ngrok allows you to expose a web server running on your local machine to the internet.
Step1
Download the ngrok and install it on your system.
In Linux Ubuntu run below command to install.
Step2
Write your flask app code and run it locally on your machine
So Now, our application is running locally on port 5001.
Do Not, close or terminate this terminal.
Step3
Open the New terminal window for Step3 i.e. exposing the local server to the internet
Just run below command
Just tell ngrok what port your web server is listening on. In our case it's 5001. If you don't know what port your web server is listening on, it's probably port 80, the default for HTTP.
When you enter above ngrok command, it will display a UI in your terminal with the public URL of your tunnel and other status and metrics information about connections made over your tunnel.
All Done !!
Just browse the highlighted URL in your mobile-phone.