register auth blueprint
This commit is contained in:
parent
75f244ae9f
commit
c8d56b5e1e
3 changed files with 22 additions and 21 deletions
3
app.py
3
app.py
|
@ -49,9 +49,10 @@ def hello_world():
|
|||
|
||||
# Blue prints
|
||||
from api.api import api
|
||||
from auth.auth import auth
|
||||
|
||||
app.register_blueprint(api)
|
||||
|
||||
app.register_blueprint(auth)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=DEBUG, port=PORT)
|
|
@ -1,14 +1,14 @@
|
|||
from flask import Blueprint, request, jsonify, session
|
||||
from ..models.User import User
|
||||
import models
|
||||
|
||||
auth = Blueprint('auth', __name__, url_prefix='/auth')
|
||||
|
||||
@api.route('/signup', methods=['POST'])
|
||||
@auth.route('/signup', methods=['POST'])
|
||||
def auth_signup():
|
||||
response = {"message": "signup post"}
|
||||
return jsonify(response)
|
||||
|
||||
@api.route('/login', methods=['POST'])
|
||||
@auth.route('/login', methods=['POST'])
|
||||
def auth_login():
|
||||
response = {"message": "login post"}
|
||||
return jsonify(response)
|
Loading…
Reference in a new issue