9
0
mirror of https://github.com/donlon/cloudflare-error-page.git synced 2025-12-19 14:59:28 +00:00

add simple editor UI and backend

This commit is contained in:
Anthony Donlon
2025-11-20 07:24:19 +08:00
parent f6b2947ec5
commit 4c6571d2f8
10 changed files with 1193 additions and 6 deletions

21
editor/server/editor.py Normal file
View File

@@ -0,0 +1,21 @@
# SPDX-License-Identifier: MIT
import os
from flask import (
Blueprint,
send_from_directory,
)
from . import get_common_cf_template_params, render_cf_error_page
root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../')
res_folder = os.path.join(root_dir, 'editor/resources')
bp = Blueprint('editor', __name__, url_prefix='/')
@bp.route('/', defaults={'path': 'index.html'})
@bp.route('/<path:path>')
def index(path: str):
return send_from_directory(res_folder, path)