mirror of
https://github.com/Starlio-app/Starlio-web.git
synced 2025-03-04 06:51:24 +03:00
Update Docker configuration to run in Yandex Cloud
This commit is contained in:
parent
79849e5de9
commit
f656492c5a
3 changed files with 10 additions and 4 deletions
9
main.py
9
main.py
|
@ -1,6 +1,8 @@
|
|||
from fastapi.staticfiles import StaticFiles
|
||||
from starlette.responses import FileResponse
|
||||
from fastapi import FastAPI
|
||||
import uvicorn
|
||||
import os
|
||||
|
||||
from src.routes import index
|
||||
from src.routes import wallpaper
|
||||
|
@ -14,12 +16,12 @@ app.mount('/static/', StaticFiles(directory='./src/web/static/'))
|
|||
app.mount('/.well-known/', StaticFiles(directory='./.well-known/'))
|
||||
|
||||
|
||||
@app.route('/app-ads.txt')
|
||||
@app.get('/app-ads.txt')
|
||||
async def app_ads(req):
|
||||
return FileResponse('./app-ads.txt')
|
||||
|
||||
|
||||
@app.route('/robots.txt')
|
||||
@app.get('/robots.txt')
|
||||
async def robots_txt(req):
|
||||
return FileResponse('./robots.txt')
|
||||
|
||||
|
@ -27,3 +29,6 @@ async def robots_txt(req):
|
|||
@app.exception_handler(404)
|
||||
async def not_found(req, __):
|
||||
return FileResponse('./src/web/html/error/404.html')
|
||||
|
||||
if __name__ == '__main__':
|
||||
uvicorn.run(app, host="0.0.0.0", port=int(os.environ['PORT']))
|
||||
|
|
Loading…
Add table
Reference in a new issue