Buckets:

download
raw
1.04 kB
"""Configuration routes for PDD Server.
Provides endpoints for server configuration and environment information.
"""
from __future__ import annotations
from fastapi import APIRouter
from pydantic import BaseModel
from pdd.core.cloud import CloudConfig
router = APIRouter(prefix="/api/v1/config", tags=["config"])
class CloudUrlResponse(BaseModel):
"""Response model for cloud URL."""
cloud_url: str
environment: str
@router.get("/cloud-url", response_model=CloudUrlResponse)
async def get_cloud_url() -> CloudUrlResponse:
"""
Get the cloud functions URL that the server is configured to use.
This ensures the frontend uses the same cloud URL as the CLI,
preventing environment mismatches (staging vs production).
Returns:
CloudUrlResponse with cloud_url and environment
"""
import os
cloud_url = CloudConfig.get_base_url()
environment = os.environ.get("PDD_ENV", "production")
return CloudUrlResponse(
cloud_url=cloud_url,
environment=environment
)

Xet Storage Details

Size:
1.04 kB
·
Xet hash:
688be3946f213cd09264eb3c56680a537f26aea19b9e5768029176fa0272489b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.