forked from MinhQuan/MiscCorpo
Refactor static serving: use Blueprint static_folder, inline header
- Disable Flask default /static/ folder (static_folder=None in app.py) - Add headerRoute blueprint to serve views/header/ at /assets/header/ - Configure transcription and scraper blueprints with static_folder pointing to their respective views/ subfolders - Inline header HTML directly in headerLoader.js (remove fetch call) - Update all HTML templates to use new /assets/... URLs
This commit is contained in:
@@ -3,10 +3,12 @@ from flask import Flask
|
||||
from config import Config
|
||||
from routes.transcriptionRoute import transcription_bp
|
||||
from routes.scraperZLibraryRoute import scraperZLibraryRoute
|
||||
from routes.headerRoute import header_bp
|
||||
|
||||
def create_app():
|
||||
"""Application factory function"""
|
||||
app = Flask(__name__, template_folder='views')
|
||||
# static_folder=None → tắt hoàn toàn thư mục /static mặc định của Flask
|
||||
app = Flask(__name__, template_folder='views', static_folder=None)
|
||||
|
||||
# Load configuration
|
||||
app.config.from_object(Config)
|
||||
@@ -18,6 +20,7 @@ def create_app():
|
||||
Config.init_app()
|
||||
|
||||
# Register blueprints
|
||||
app.register_blueprint(header_bp)
|
||||
app.register_blueprint(transcription_bp)
|
||||
app.register_blueprint(scraperZLibraryRoute, url_prefix='/scraperZLibrary')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user