re-add api route

This commit is contained in:
2025-07-02 13:35:14 +03:00
parent 3c3837b3f2
commit 64e18f16dd
4 changed files with 85 additions and 3 deletions

View File

@ -76,11 +76,13 @@ def create_app():
from app.routes.threads import bp as threads_bp
from app.routes.users import bp as users_bp
from app.routes.mod import bp as mod_bp
from app.routes.api import bp as api_bp
app.register_blueprint(app_bp)
app.register_blueprint(topics_bp)
app.register_blueprint(threads_bp)
app.register_blueprint(users_bp)
app.register_blueprint(mod_bp)
app.register_blueprint(api_bp)
app.config['SESSION_COOKIE_SECURE'] = True
@ -88,11 +90,12 @@ def create_app():
def make_session_permanent():
session.permanent = True
commit = ""
with open('.git/refs/heads/main') as f:
commit = f.read().strip()
@app.context_processor
def inject_constants():
commit = ""
with open('.git/refs/heads/main') as f:
commit = f.read().strip()
return {
"InfoboxIcons": InfoboxIcons,
"InfoboxHTMLClass": InfoboxHTMLClass,