diff --git a/halfapi/app.py b/halfapi/app.py index 54097dc..3b22528 100644 --- a/halfapi/app.py +++ b/halfapi/app.py @@ -9,6 +9,7 @@ from starlette.applications import Starlette from starlette.middleware import Middleware from starlette.requests import Request from starlette.responses import Response, JSONResponse +from starlette.routing import Route from starlette.types import ASGIApp from starlette.middleware.authentication import AuthenticationMiddleware @@ -102,9 +103,9 @@ def check_conf(): DEBUG = True debug_routes = [ - AppRoute('/', lambda request: PlainTextResponse('It Works!')), - AppRoute('/user', lambda request: JSONResponse({'user':request.user})), - AppRoute('/payload', lambda request: JSONResponse({'payload':request.payload})) + Route('/', lambda request: PlainTextResponse('It Works!')), + Route('/user', lambda request: JSONResponse({'user':request.user})), + Route('/payload', lambda request: JSONResponse({'payload':request.payload})) ] if DEBUG is True else [] app = Starlette( diff --git a/halfapi/lib/acl_caller_middleware.py b/halfapi/lib/acl_caller_middleware.py index 3515642..f9c14e5 100644 --- a/halfapi/lib/acl_caller_middleware.py +++ b/halfapi/lib/acl_caller_middleware.py @@ -4,7 +4,7 @@ from starlette.middleware.base import BaseHTTPMiddleware from starlette.routing import Match, Mount from starlette.types import ASGIApp, Receive, Scope, Send -from .models.api.view.acl import Acl as AclView +from halfapi.models.api.view.acl import Acl as AclView def match_route(scope: Scope): """ Checks all routes from "app" and checks if it matches with the one from