23 lines
573 B
Python
23 lines
573 B
Python
import logging
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from .schema import ConfigReturnSchema, ConfigSchema
|
|
|
|
logger = logging.getLogger("uvicorn")
|
|
|
|
router = APIRouter(tags=["config"])
|
|
|
|
|
|
@router.post(
|
|
"/config", summary="Upload a configuration", response_model=ConfigReturnSchema
|
|
)
|
|
async def create_config(config: ConfigSchema) -> ConfigSchema:
|
|
"""
|
|
Endpoint to receive and store configuration data.
|
|
|
|
⚠️ at this time the configuration is not stored anywhere. It's like logging to /dev/null
|
|
"""
|
|
logger.info("Received configuration data")
|
|
return config
|