Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,20 +23,14 @@ app = Flask(__name__, template_folder="templates", static_folder="static")
|
|
23 |
def index():
|
24 |
return render_template("index.html")
|
25 |
|
26 |
-
@app.route('
|
27 |
-
def
|
28 |
-
|
29 |
-
|
30 |
-
@app.route('/pages/<path:filename>')
|
31 |
-
def serve_pages(filename):
|
32 |
-
# static/pages γγ£γ¬γ―γγͺγγι
δΏ‘
|
33 |
-
return send_from_directory(os.path.join(app.static_folder, "pages"), filename)
|
34 |
-
|
35 |
-
@app.route('/Gallery Files/<path:filename>')
|
36 |
-
def serve_gallery_files(filename):
|
37 |
-
return send_from_directory(os.path.join(app.static_folder, "Gallery Files"), filename)
|
38 |
-
|
39 |
|
|
|
|
|
|
|
|
|
40 |
|
41 |
# θͺγΏεγε°η¨γγ‘γ€γ«γει€γ§γγγγγ«γγ
|
42 |
def remove_readonly(func, path, excinfo):
|
|
|
23 |
def index():
|
24 |
return render_template("index.html")
|
25 |
|
26 |
+
@app.route('/<path:filepath>')
|
27 |
+
def serve_any(filepath):
|
28 |
+
full_path = os.path.join(REPO_DIR, filepath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
if os.path.isfile(full_path):
|
31 |
+
return send_from_directory(REPO_DIR, filepath)
|
32 |
+
else:
|
33 |
+
abort(404)
|
34 |
|
35 |
# θͺγΏεγε°η¨γγ‘γ€γ«γει€γ§γγγγγ«γγ
|
36 |
def remove_readonly(func, path, excinfo):
|