File size: 569 Bytes
af32bc7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from flask import Flask, render_template, send_from_directory
import os
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/images/<path:filename>')
def images(filename):
# After flattening repository, images are at the project root. Serve from root.
return send_from_directory(app.root_path, filename)
@app.route('/pngegg.png')
def tree_png():
return send_from_directory(app.root_path, 'pngegg.png')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
|