diff --git a/integration_tests/base_routes.py b/integration_tests/base_routes.py index 8e5e2c633..37a181fb4 100644 --- a/integration_tests/base_routes.py +++ b/integration_tests/base_routes.py @@ -486,6 +486,7 @@ async def async_raise(): # ===== Main ===== + @app.view("/test_decorator_view") def decorator_view(): def get(): @@ -496,7 +497,6 @@ def post(request): return {"status_code": 200, "body": body} - if __name__ == "__main__": app.add_request_header("server", "robyn") app.add_directory( diff --git a/robyn/__init__.py b/robyn/__init__.py index 84a54125a..c915e12a8 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -194,6 +194,7 @@ def view(self, endpoint: str, const: bool = False): :param endpoint str: endpoint to server the route """ + def inner(handler): return self.add_view(endpoint, handler, const)