Если в конфиге нет токена для аналитики, то она не будет работать
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Has been cancelled

This commit is contained in:
Данил 2024-10-23 17:01:26 +03:00
parent c9dd20dbb7
commit a08f848d56

View file

@ -1,3 +1,5 @@
import http
import uvicorn
import yaml
@ -13,6 +15,7 @@ from src.routes import wallpaper
app = FastAPI()
if config['analytics']['token']:
app.middleware('http')(PlausibleAnalytics())
app.include_router(index.router)
@ -34,7 +37,7 @@ async def robots_txt():
@app.exception_handler(404)
async def not_found(req, __):
return FileResponse('./src/web/html/error/404.html')
return FileResponse('./src/web/html/error/404.html', status_code=http.HTTPStatus.NOT_FOUND)
if __name__ == '__main__':
uvicorn.run(app,