Files
Gipat/services/drive2/app/server.py
Pan'kov Maksim 029839154e drive2 feed
2025-09-13 00:18:39 +03:00

13 lines
339 B
Python

from fastapi import FastAPI, Response
from generator import generate
from cachetools import cached, TTLCache
import math
app = FastAPI()
@app.get("/")
@cached(cache=TTLCache(maxsize=math.inf, ttl=3600))
def read_root(url: str):
atom = generate(url)
return Response(content=atom, media_type='application/atom+xml; charset=utf-8')