mirror of
https://github.com/Starlio-app/Starlio-web.git
synced 2024-11-22 00:36:20 +03:00
Сделал роуты для рекламы и подтверждение ссылок
This commit is contained in:
parent
57bb09e94c
commit
3017d85bcd
1 changed files with 23 additions and 0 deletions
23
main.py
Normal file
23
main.py
Normal file
|
@ -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')
|
Loading…
Add table
Reference in a new issue