сделал uvicorn run

This commit is contained in:
Данил 2024-10-19 19:14:36 +03:00
parent 6051cc26d8
commit e26daac0dc

View file

@ -1,3 +1,4 @@
import uvicorn
from fastapi.staticfiles import StaticFiles from fastapi.staticfiles import StaticFiles
from starlette.responses import FileResponse from starlette.responses import FileResponse
from fastapi import FastAPI from fastapi import FastAPI
@ -12,3 +13,6 @@ app.mount('/static/', StaticFiles(directory='./src/web/static/'))
@app.exception_handler(404) @app.exception_handler(404)
async def not_found(req, __): async def not_found(req, __):
return FileResponse('./src/web/errors/404.html') return FileResponse('./src/web/errors/404.html')
if __name__ == '__main__':
uvicorn.run(app, host='0.0.0.0', port=9000)