[FIX] Import app from index.py instead of creating duplicate (fix) | ApprovalToken: AT-202512310904
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -5,54 +5,8 @@ This is the main application file that Reflex uses to run the app.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
from src.presentation.web.pages.landing.index import index
|
# Import the app that is already created in index.py
|
||||||
from src.presentation.api.routes.health import (
|
from src.presentation.web.pages.landing.index import app
|
||||||
ping_endpoint,
|
|
||||||
health_endpoint,
|
|
||||||
ready_endpoint,
|
|
||||||
live_endpoint,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create the app
|
# The app is already fully configured in index.py with all pages and routes
|
||||||
app = rx.App()
|
# No need to add additional pages here
|
||||||
|
|
||||||
# Add landing page
|
|
||||||
app.add_page(index, route="/")
|
|
||||||
|
|
||||||
# Add health check pages (for Kubernetes probes)
|
|
||||||
# These return JSON responses for monitoring
|
|
||||||
@rx.page(route="/ping")
|
|
||||||
def ping():
|
|
||||||
"""Basic health check endpoint"""
|
|
||||||
data = ping_endpoint()
|
|
||||||
return rx.box(
|
|
||||||
rx.text(str(data)),
|
|
||||||
style={"whiteSpace": "pre"}
|
|
||||||
)
|
|
||||||
|
|
||||||
@rx.page(route="/health")
|
|
||||||
def health():
|
|
||||||
"""Detailed health check endpoint"""
|
|
||||||
data = health_endpoint()
|
|
||||||
return rx.box(
|
|
||||||
rx.text(str(data)),
|
|
||||||
style={"whiteSpace": "pre"}
|
|
||||||
)
|
|
||||||
|
|
||||||
@rx.page(route="/ready")
|
|
||||||
def ready():
|
|
||||||
"""Readiness probe endpoint"""
|
|
||||||
data = ready_endpoint()
|
|
||||||
return rx.box(
|
|
||||||
rx.text(str(data)),
|
|
||||||
style={"whiteSpace": "pre"}
|
|
||||||
)
|
|
||||||
|
|
||||||
@rx.page(route="/live")
|
|
||||||
def live():
|
|
||||||
"""Liveness probe endpoint"""
|
|
||||||
data = live_endpoint()
|
|
||||||
return rx.box(
|
|
||||||
rx.text(str(data)),
|
|
||||||
style={"whiteSpace": "pre"}
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user