Files
MiscCorpo/app.py
T
hiep200311 adc1934e9c 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
2026-06-24 16:22:31 +07:00

31 lines
976 B
Python

# app.py
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"""
# 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)
# Remove MAX_CONTENT_LENGTH limit for chunked uploads
app.config['MAX_CONTENT_LENGTH'] = None
# Initialize folders
Config.init_app()
# Register blueprints
app.register_blueprint(header_bp)
app.register_blueprint(transcription_bp)
app.register_blueprint(scraperZLibraryRoute, url_prefix='/scraperZLibrary')
return app
if __name__ == '__main__':
app = create_app()
app.run(debug=True, host='0.0.0.0', port=5000)