-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.py
35 lines (26 loc) · 832 Bytes
/
editor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import flask
from flask import Flask
def run_flask():
app = Flask(__name__)
# set timeout to 5 seconds
#app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 5
# return files from the "static" folder
@app.route('/<path:path>')
def path(path):
if path == "favicon.ico":
return ""
#return flask.render_template(f"{path}.html")
return ""
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/css/<path:path>')
def css(path):
return flask.send_from_directory('assets', path)
@app.route('/js/<path:path>')
def js(path):
return flask.send_from_directory('assets', path)
# make visible for all ips
app.run(host='0.0.0.0',debug=True)
if __name__ == "__main__":
run_flask()