- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleapp.py
More file actions
Latest commit
22 lines (17 loc) · 595 Bytes
/
Copy pathsimpleapp.py
File metadata and controls
22 lines (17 loc) · 595 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
fromflaskimportFlask
importsys
importoptparse
importtime
app=Flask(__name__)
start=int(round(time.time()))
@app.route("/")
defhello_world():
return"Hello world from Distelli & Docker!"
if__name__=='__main__':
parser=optparse.OptionParser(usage="python simpleapp.py -p ")
parser.add_option('-p', '--port', action='store', dest='port', help='The port to listen on.')
(args, _) =parser.parse_args()
ifargs.port==None:
print"Missing required argument: -p/--port"
sys.exit(1)
app.run(host='0.0.0.0', port=int(args.port), debug=False)