From 532266c98e6f1c9c54870f6ec0fd0dde4e8b220b Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Sun, 26 Oct 2025 15:21:48 +0300 Subject: [PATCH] refactor(auth): remove /api/auth/* handlers to api/auth.py --- api/{auth/loginapi.py => auth.py} | 4 ++-- app.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename api/{auth/loginapi.py => auth.py} (87%) diff --git a/api/auth/loginapi.py b/api/auth.py similarity index 87% rename from api/auth/loginapi.py rename to api/auth.py index ab095e9..0c357e8 100644 --- a/api/auth/loginapi.py +++ b/api/auth.py @@ -1,10 +1,10 @@ from flask import Blueprint, request, jsonify from model.user import User -loginBP = Blueprint("loginapi", __name__) +auth = Blueprint("auth", __name__) -@loginBP.route('/api/auth/login', methods = ['POST']) +@auth.route('/login', methods = ['POST']) def login(): if request.is_json: req = request.json diff --git a/app.py b/app.py index f225ca0..b7752b6 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,6 @@ from sys import exit from flask import Flask -from api.auth.loginapi import loginBP +from api.auth import auth from utils.loadDotEnv import initializeENV from utils.PostgressConnect import PSQLConnect, PSQLCursor @@ -12,4 +12,4 @@ if not initializeENV(): app = Flask(__name__) -app.register_blueprint(loginBP) +app.register_blueprint(auth, url_prefix='/api/auth')