9
0
mirror of https://github.com/donlon/cloudflare-error-page.git synced 2026-01-06 15:41:45 +00:00
Files
cloudflare-error-page/editor/server/app/editor.py
2025-12-28 22:58:01 +08:00

19 lines
381 B
Python

# SPDX-License-Identifier: MIT
from os import abort
from flask import (
Blueprint,
send_from_directory,
)
from . import static_dir
bp = Blueprint('editor', __name__, url_prefix='/')
@bp.route('/', defaults={'path': 'index.html'})
@bp.route('/<path:path>')
def index(path: str):
if not static_dir:
abort(500)
return send_from_directory(static_dir, path)