This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
Reflex expects to find 'app' in peikarband.landing when app_name='landing'.
|
||||
"""
|
||||
|
||||
from peikarband.app import app
|
||||
from .peikarband import app
|
||||
|
||||
__all__ = ["app"]
|
||||
__all__ = ["app"]
|
||||
58
peikarband/peikarband/peikarband.py
Normal file
58
peikarband/peikarband/peikarband.py
Normal file
@@ -0,0 +1,58 @@
|
||||
"""
|
||||
Peikarband Application Entry Point
|
||||
|
||||
This is the main application file that Reflex uses to run the app.
|
||||
"""
|
||||
|
||||
import reflex as rx
|
||||
from src.presentation.web.pages.landing.index import index
|
||||
from src.presentation.api.routes.health import (
|
||||
ping_endpoint,
|
||||
health_endpoint,
|
||||
ready_endpoint,
|
||||
live_endpoint,
|
||||
)
|
||||
|
||||
# Create the app
|
||||
app = rx.App()
|
||||
|
||||
# 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