diff --git a/webservice/api.py b/webservice/api.py index ac29160..7c5611c 100644 --- a/webservice/api.py +++ b/webservice/api.py @@ -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'] diff --git a/webservice/interface.py b/webservice/interface.py index 7541934..fc42624 100644 --- a/webservice/interface.py +++ b/webservice/interface.py @@ -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__)))