freeleaps-service-hub/apps/metrics/webapi/main.py
weicao 35fbda6954 Refactor metrics service: rename files for better readability
- Rename starrocks_client.py -> database_client.py
- Rename daily_registered_users.py -> user_registration_models.py
- Rename daily_registration_service.py -> registration_analytics_service.py
- Rename daily_registration.py -> registration_metrics.py
- Rename site_settings.py -> app_settings.py
- Rename application.py -> app_factory.py
- Update all import statements and references
- Update README.md with new file structure
2025-09-15 16:31:20 +08:00

37 lines
893 B
Python

from webapi.bootstrap.app_factory import create_app
from webapi.config.app_settings import site_settings
from fastapi.responses import RedirectResponse
import uvicorn
from typing import Any
from webapi.routes import registration_metrics
app = create_app()
# Include routers
app.include_router(registration_metrics.router)
@app.get("/", status_code=301)
async def root():
"""
TODO: redirect client to /docs
"""
return RedirectResponse("docs")
if __name__ == "__main__":
uvicorn.run(
app="main:app", host=site_settings.SERVER_HOST, port=site_settings.SERVER_PORT
)
def get_context() -> Any:
# Define your context function. This is where you can set up authentication, database connections, etc.
return {}
def get_root_value() -> Any:
# Define your root value function. This is where you can set up the root value for GraphQL.
return {}