Skip to content

Instantly share code, notes, and snippets.

@gabber12
Last active May 21, 2017 20:12
Show Gist options
  • Save gabber12/8109d10ba732ac380502135489b28c97 to your computer and use it in GitHub Desktop.
Save gabber12/8109d10ba732ac380502135489b28c97 to your computer and use it in GitHub Desktop.
Hello flask application
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_flask():
return "Hello world"
app.run(host="0.0.0.0", port=8090)
cd /tmp
echo "Getting a python server up"
curl -O https://gist.githubusercontent.com/gabber12/8109d10ba732ac380502135489b28c97/raw/0daa654e9f4e9ae16de2bf396b005a70ebc71240/hello-flask.py
virtualenv venv
source venv/bin/activate
pip install flask
python hello-flask.py &
PID=$!
echo "Getting ngrok started"
linux="linux"
mac="mac"
port=8090
if [ "$1" == "$linux" ]
then
curl -O https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
./ngrok http $port
fi
if [ "$1" == "$mac" ]
then
curl -O https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-amd64.zip
unzip ngrok-stable-darwin-amd64.zip
./ngrok http $port
fi
rm -rf venv
kill $PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment