Last active
May 21, 2017 20:12
-
-
Save gabber12/8109d10ba732ac380502135489b28c97 to your computer and use it in GitHub Desktop.
Hello flask application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello_flask(): | |
return "Hello world" | |
app.run(host="0.0.0.0", port=8090) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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