Closed
Description
as an amendment to #481 the routing as intended by #478 is broken.
examples/tutorial/routes/route3.py has been modified slightly for this:
# Justpy Tutorial demo from docs/tutorial/routes.md
import justpy as jp
def greeting_function(request):
wp = jp.WebPage()
name=f"""{request.path_params["name"]}"""
wp.add(jp.P(text=f'Hello there, {name}!', classes='text-5xl m-2'))
return wp
jp.Route('/hello/{name}', greeting_function)
# initialize the demo
from examples.basedemo import Demo
Demo ("route3",None)
scripts/start examples/tutorial/routes/route3.py
http://localhost:8000/hello/budy
will lead to
KeyError: 'name'
name=f"""{request.path_params["name"]}"""