def add_all_routes_endpoint(self):
        """Add an endpoint to the app that returns all the routes."""
        if not self._api:
            return

        async def all_routes(_request: Request) -> Response:
            return JSONResponse(list(self._unevaluated_pages.keys()))

        self._api.add_route(
            str(constants.Endpoint.ALL_ROUTES), all_routes, methods=["GET"]
        )
Add an endpoint to the app that returns all the routes.
reflex/app.py