18 lines
335 B
Python
18 lines
335 B
Python
from fastapi import APIRouter
|
|
from starlette.responses import Response
|
|
|
|
from fabcal.calendar_client import get_data
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/events.ics")
|
|
async def events_ics():
|
|
return Response(
|
|
(await get_data()).to_ical(True),
|
|
headers={
|
|
"content-type": "text/calendar",
|
|
},
|
|
)
|