Fixed endpoint urls
This commit is contained in:
parent
00921dc505
commit
6cbef534de
@ -6,11 +6,11 @@ from db import db
|
||||
from helper_functions import check_password, hash_password
|
||||
from models import User
|
||||
|
||||
api = Blueprint('api', __name__, url_prefix='/api/v1/resources/devices')
|
||||
api = Blueprint('api', __name__, url_prefix='/api')
|
||||
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
||||
|
||||
|
||||
@api.route('/api/users', methods=['GET'])
|
||||
@api.route('/users', methods=['GET'])
|
||||
def users():
|
||||
res = []
|
||||
for i in User.query.all():
|
||||
@ -19,7 +19,7 @@ def users():
|
||||
return jsonify(res)
|
||||
|
||||
|
||||
@api.route('/api/login', methods=['POST'])
|
||||
@api.route('/login', methods=['POST'])
|
||||
def login():
|
||||
request_data = request.get_json()
|
||||
username = request_data['username']
|
||||
@ -32,13 +32,13 @@ def login():
|
||||
return False
|
||||
|
||||
|
||||
@api.route('/api/logout', methods=['GET'])
|
||||
@api.route('/logout', methods=['GET'])
|
||||
def logout():
|
||||
# TODO
|
||||
pass
|
||||
|
||||
|
||||
@api.route('/api/register', methods=['POST'])
|
||||
@api.route('/register', methods=['POST'])
|
||||
def register():
|
||||
request_data = request.get_json()
|
||||
username = request_data['username']
|
||||
|
@ -2,7 +2,7 @@ import os
|
||||
|
||||
from flask import Blueprint
|
||||
|
||||
interface = Blueprint('interface', __name__, url_prefix='/api/v1/resources/devices')
|
||||
interface = Blueprint('interface', __name__, url_prefix='/')
|
||||
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user