Skip to content

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

@masenf

Description

@masenf

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions