get ticker ui config

This commit is contained in:
Jörn-Michael Miehe 2022-09-09 00:04:13 +00:00
parent ccbac0a455
commit 1f2b5a9607

View file

@ -15,7 +15,7 @@ from typing import Iterator
from fastapi import APIRouter, Depends from fastapi import APIRouter, Depends
from markdown import markdown from markdown import markdown
from ..config import Config from ..config import Config, TickerUIConfig
from ..dav_common import webdav_ensure_path from ..dav_common import webdav_ensure_path
from ..dav_file import DavFile from ..dav_file import DavFile
from .text import text_lister, text_unique from .text import text_lister, text_unique
@ -82,3 +82,13 @@ async def get_raw_ticker(
ticker_content: str = Depends(get_ticker_content), ticker_content: str = Depends(get_ticker_content),
) -> str: ) -> str:
return ticker_content return ticker_content
@ router.get(
"/config",
response_model=TickerUIConfig,
)
async def get_ui_config(
cfg: Config = Depends(Config.get),
) -> TickerUIConfig:
return cfg.ticker.ui