soiz1 commited on
Commit
79c1109
Β·
verified Β·
1 Parent(s): 14a9c78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
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('/static/<path:filename>')
27
- def serve_static(filename):
28
- return send_from_directory(app.static_folder, filename)
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):