Add user blueprint to app.py
This commit is contained in:
parent
c6add58ee1
commit
36bdcd5e6f
3 changed files with 15 additions and 10 deletions
|
@ -1,11 +1,3 @@
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
|
||||||
api = Blueprint("api", __name__)
|
api = Blueprint("api", __name__)
|
||||||
|
|
||||||
@api.route("/api/register", methods=["POST"])
|
|
||||||
def register():
|
|
||||||
pass
|
|
||||||
|
|
||||||
@api.route("/api/login", methods=["POST"])
|
|
||||||
def login():
|
|
||||||
pass
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from flask import Blueprint
|
from flask import Blueprint, session
|
||||||
from utils import api_wrapper
|
from utils import api_wrapper
|
||||||
|
|
||||||
blueprint = Blueprint("user", __name__)
|
blueprint = Blueprint("user", __name__)
|
||||||
|
@ -6,4 +6,15 @@ blueprint = Blueprint("user", __name__)
|
||||||
@blueprint.route("/register", methods=["POST"])
|
@blueprint.route("/register", methods=["POST"])
|
||||||
@api_wrapper
|
@api_wrapper
|
||||||
def user_register():
|
def user_register():
|
||||||
return { "success": 0, "message": "Registration is not open yet." }
|
return { "success": 0, "message": "Registration is not open yet." }
|
||||||
|
|
||||||
|
@blueprint.route("/logout", methods=["POST"])
|
||||||
|
@api_wrapper
|
||||||
|
def user_logout():
|
||||||
|
# session.clear()
|
||||||
|
pass
|
||||||
|
|
||||||
|
@blueprint.route("/login", methods=["POST"])
|
||||||
|
@api_wrapper
|
||||||
|
def user_login():
|
||||||
|
pass
|
|
@ -6,10 +6,12 @@ import json
|
||||||
import api
|
import api
|
||||||
|
|
||||||
from api.api import api as api_blueprint
|
from api.api import api as api_blueprint
|
||||||
|
from api.user import blueprint as user_blueprint
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.secret_key = config.SECRET
|
app.secret_key = config.SECRET
|
||||||
app.register_blueprint(api_blueprint)
|
app.register_blueprint(api_blueprint)
|
||||||
|
app.register_blueprint(user_blueprint)
|
||||||
|
|
||||||
@app.route("/api")
|
@app.route("/api")
|
||||||
def api_main():
|
def api_main():
|
||||||
|
|
Loading…
Reference in a new issue