fastapi-with-liveview/about_us.py
Andros Fenollosa 6a9fc0a72a Fist commit
2024-06-18 14:50:41 +02:00

20 lines
500 B
Python

from datetime import datetime
async def send_page(websocket, templates, data_frontend):
await websocket.send_json(
{
'selector': '#main',
'html': templates.get_template(
f'pages/about_us.html'
).render(),
}
)
async def current_time(websocket, templates, data_frontend):
await websocket.send_json(
{
'selector': '#time',
'html': f"<datetime>{datetime.now()}</datetime>",
}
)