Skip to content

FastAPI removal breaks @app.api.get usage #5181

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Closed
masenf opened this issue Apr 25, 2025 · 1 comment
Closed

FastAPI removal breaks @app.api.get usage #5181

masenf opened this issue Apr 25, 2025 · 1 comment
Assignees

Comments

@masenf
Copy link
Collaborator

masenf commented Apr 25, 2025

Describe the bug

import reflex as rx


class State(rx.State):
    """The app state."""

    ...


def index() -> rx.Component:
    gotten_app = rx.utils.prerequisites.get_app().app  # pyright: ignore [reportAttributeAccessIssue]

    @gotten_app.api.get("/foo")
    def foo():
        return {"hi": "mom"}

    # Welcome Page (Index)
    return rx.container(
        rx.heading("Hello, World!"),
        rx.logo(),
    )

app = rx.App()
app.add_page(index)

Expected behavior
The code above installs an endpoint at http://localhost:8000/foo on 0.7.8, but on 0.7.9a1, it does not

Specifics (please complete the following information):

  • Python Version: 3.13
  • Reflex Version: 0.7.9a1
  • OS: macOS
Copy link

linear bot commented Apr 25, 2025

@adhami3310 adhami3310 self-assigned this Apr 25, 2025
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants