From 2f3c26c4c3da7d4e7e0736d4243e420e136cb765 Mon Sep 17 00:00:00 2001 From: Wolfgang Fahl Date: Wed, 14 Sep 2022 14:54:27 +0200 Subject: [PATCH] adds legacy Route for compatibility --- justpy/justpy.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/justpy/justpy.py b/justpy/justpy.py index 9045a857..c28d3f71 100644 --- a/justpy/justpy.py +++ b/justpy/justpy.py @@ -24,7 +24,7 @@ from .routing import SetRoute from .utilities import run_task, create_delayed_task import uvicorn, logging, sys, os, traceback - +import typing # # globals # @@ -190,6 +190,15 @@ def get_server(): """ return jp_server +def Route(path:str,wpfunc:typing.Callable): + """ + legacy Route handling + + Args: + path:str + """ + app.add_jproute(path,wpfunc) + def justpy( func=None,