This commit is contained in:
Данил 2024-09-18 17:14:04 +03:00
parent 2f0e43a994
commit 120c84418b
3 changed files with 5 additions and 2 deletions

View file

@ -18,6 +18,7 @@ app.mount('/.well-known/', StaticFiles(directory='./.well-known/'))
async def app_ads(req, __):
return FileResponse('./app-ads.txt')
@app.exception_handler(404)
async def not_found(req, __):
return FileResponse('./src/web/html/error/404.html')

View file

@ -3,6 +3,7 @@ from fastapi.responses import FileResponse
router = APIRouter()
@router.get('/')
async def main():
return FileResponse('./src/web/html/index.html')
return FileResponse('./src/web/html/index.html')

View file

@ -8,6 +8,7 @@ router = APIRouter()
template = Jinja2Templates(directory='./src/web/html')
@router.get('/wallpaper/{day}', response_class=HTMLResponse)
async def wallpaper(request: Request, day):
token = '1gI9G84ZafKDEnrbydviGknReOGiVK9jqrQBE3et'
@ -20,4 +21,4 @@ async def wallpaper(request: Request, day):
request,
'/wallpaper.html',
{'info': res.json()}
)
)