Solution 1
!pip install pyngrok==4.1.1
!pip install pyngrok==4.1.1
!pip install flask_ngrok
from google.colab import drive
drive.mount('/content/drive')
cd /content/drive/MyDrive/mini
!ngrok authtoken "Add auth token here" #Without "" marks
from flask_ngrok import run_with_ngrok
from flask import Flask, render_template
app = Flask(__name__)
run_with_ngrok(app)
@app.route('/')
def text():
return f"Running Flask on Google Colab"
app.run()
Solution 2
ngrok http yourPort (for jsonserver default is 3000)