From 3017d85bcd9387902b4fb27889f2e7fac64953f0 Mon Sep 17 00:00:00 2001 From: Redume Date: Sat, 14 Sep 2024 21:05:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D1=80?= =?UTF-8?q?=D0=BE=D1=83=D1=82=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D0=BC=D1=8B=20=D0=B8=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=80=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D1=81=D1=81=D1=8B=D0=BB=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..59e4ad6 --- /dev/null +++ b/main.py @@ -0,0 +1,23 @@ +from fastapi.staticfiles import StaticFiles +from starlette.responses import FileResponse +from fastapi import FastAPI, APIRouter + +from src.routes import index +from src.routes import wallpaper + +app = FastAPI() + +app.include_router(index.router) +app.include_router(wallpaper.router) + +app.mount('/static/', StaticFiles(directory='./src/web/static/')) +app.mount('/.well-known/', StaticFiles(directory='./.well-known/')) + + +@app.route('/app-ads.txt') +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') \ No newline at end of file