Programmatical uvicorn start

This commit is contained in:
inexcode 2022-08-12 17:43:04 +04:00
parent a96f6bd067
commit 43675b2d1d
3 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "portalocker", "flask-swagger", "flask-swagger-ui"]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "wheel", "portalocker"]
build-backend = "setuptools.build_meta"

View file

@ -5,6 +5,8 @@ from fastapi import FastAPI, Depends, Request, WebSocket, BackgroundTasks
from fastapi.middleware.cors import CORSMiddleware
from strawberry.fastapi import BaseContext, GraphQLRouter
import uvicorn
from selfprivacy_api.dependencies import get_api_version, get_graphql_context
from selfprivacy_api.graphql.schema import schema
from selfprivacy_api.migrations import run_migrations
@ -49,3 +51,6 @@ async def get_version():
async def startup():
run_migrations()
init_restic()
if __name__ == "__main__":
uvicorn.run("app:app", host="0.0.0.0", port=5050, log_level="info")

View file

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="selfprivacy_api",
version="1.2.7",
version="2.0.0",
packages=find_packages(),
scripts=[
"selfprivacy_api/app.py",