Created
October 14, 2014 21:17
-
-
Save ericchiang/7bf5e3837ad22d555332 to your computer and use it in GitHub Desktop.
Flask hello world
This file contains hidden or 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
import sys | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "Hello World!" | |
if __name__ == "__main__": | |
try: | |
port = int(sys.argv[1]) | |
except: | |
print "No port specified, reverting to 8888" | |
port = 8888 | |
app.run(port=port) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment