This commit is contained in:
piecka 2025-03-21 11:19:20 +01:00
commit 42f1d1012f
18 changed files with 399 additions and 0 deletions

22
app/__init__.py Normal file
View file

@ -0,0 +1,22 @@
from flask import Flask
import os
from app.config import Config
def create_app(config_class=Config):
app = Flask(__name__)
app.config.from_object(config_class)
# Ensure upload directory exists
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
# Create empty URI map file if it doesn't exist
uri_map_path = os.path.join(app.config['UPLOAD_FOLDER'], 'uri_map.json')
if not os.path.exists(uri_map_path):
with open(uri_map_path, 'w') as f:
f.write('{}')
# Register blueprints
from app.routes.main import main_bp
app.register_blueprint(main_bp)
return app