Skip to content

Instantly share code, notes, and snippets.

@arifsuhan
Last active July 9, 2023 11:30
Show Gist options
  • Save arifsuhan/cb3de89ef1a8fa4513dbb9190aeec30e to your computer and use it in GitHub Desktop.
Save arifsuhan/cb3de89ef1a8fa4513dbb9190aeec30e to your computer and use it in GitHub Desktop.
Setup Flask and Run using ngrok (tunnelling of localhost) | gcp | gcloud | web server

Setup Flask

Purpose Command
Create Directory mkdir [Project_Name]
Go to Directory cd [Project_Name]
Create Virtual Env python3 -m venv venv
Active Virtual Env . venv/bin/activate
Install Flask pip install Flask

Follow: A Minimal Application

Setup Ngrok

  • Download from here
Wget [file url]
  • Unzip File
Unzip [filename]

Setup Localtunnel

sudo apt update
sudo apt install npm
sudo npm install -g localtunnel

Finally

  • Run Flask
flask run 
or
python3 app.py
  • Run ngrok
./ngrok http [Port]
# ./ngrok http 8080

# lt --port 8080
lt --local-host 127.0.0.1 --port 5000 --subdomain hello
# npm install -g localtunnel
# . venv/bin/activate
# https://www.softwaretestinghelp.com/ngrok-alternatives/
# https://github.com/pallets/flask/tree/main/examples/tutorial/flaskr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment