forked from fl0zone/template-python
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
Latest commit
21 lines (15 loc) · 447 Bytes
/
Copy pathserver.py
File metadata and controls
21 lines (15 loc) · 447 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
importos
fromflaskimportFlask, send_from_directory, render_template, redirect
app=Flask(__name__)
port=int(os.environ.get("PORT", 5000))
@app.route('/static/<path:path>')
defserve_static(path):
returnsend_from_directory('static', path)
@app.route('/')
defhome():
returnrender_template('index.html')
@app.route('/<path:path>')
defall_routes(path):
returnredirect('/')
if__name__=="__main__":
app.run(port=port)