drive2 feed
This commit is contained in:
12
services/drive2/app/server.py
Normal file
12
services/drive2/app/server.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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')
|
||||
Reference in New Issue
Block a user