mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 15:31:28 +00:00
Programmatical uvicorn start
This commit is contained in:
parent
a96f6bd067
commit
43675b2d1d
|
@ -1,3 +1,3 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools", "wheel", "portalocker", "flask-swagger", "flask-swagger-ui"]
|
requires = ["setuptools", "wheel", "portalocker"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
|
@ -5,6 +5,8 @@ from fastapi import FastAPI, Depends, Request, WebSocket, BackgroundTasks
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from strawberry.fastapi import BaseContext, GraphQLRouter
|
from strawberry.fastapi import BaseContext, GraphQLRouter
|
||||||
|
|
||||||
|
import uvicorn
|
||||||
|
|
||||||
from selfprivacy_api.dependencies import get_api_version, get_graphql_context
|
from selfprivacy_api.dependencies import get_api_version, get_graphql_context
|
||||||
from selfprivacy_api.graphql.schema import schema
|
from selfprivacy_api.graphql.schema import schema
|
||||||
from selfprivacy_api.migrations import run_migrations
|
from selfprivacy_api.migrations import run_migrations
|
||||||
|
@ -49,3 +51,6 @@ async def get_version():
|
||||||
async def startup():
|
async def startup():
|
||||||
run_migrations()
|
run_migrations()
|
||||||
init_restic()
|
init_restic()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
uvicorn.run("app:app", host="0.0.0.0", port=5050, log_level="info")
|
||||||
|
|
Loading…
Reference in a new issue