Replies: 1 comment
-
I just got it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to math a url like http://xxx.xxx.com/test/xxx/xxx
following code just response 404, seems routers '/test/*': route_test dosn't work
should I use Regular Expression?
async def route_plaintext(scope, proto):
# sample plaintext code here
pass
async def handle_404(scope, proto):
# some 404 code here
pass
async def route_test(scope, proto):
path = scope.path
print(path)
routes = {
'/plaintext': route_plaintext,
'/test/*': route_test
}
def main(scope, proto):
handler = routes.get(scope.path, handle_404)
return handler(scope, proto)
Beta Was this translation helpful? Give feedback.
All reactions