feat: with Playground mounted on /
All checks were successful
deploy / deploy (push) Successful in 52s

This commit is contained in:
Stepan Vladovskiy 2024-04-10 10:18:52 -03:00
parent dbf1d8880d
commit a774108b18

View File

@ -4,8 +4,9 @@ from os.path import exists
from ariadne import load_schema_from_path, make_executable_schema
from starlette.applications import Starlette
from ariadne.asgi import GraphQL
from starlette.routing import Route
from starlette.responses import JSONResponse
from services.rediscache import redis
from services.schema import resolvers
@ -24,9 +25,6 @@ async def start():
f.write(str(os.getpid()))
print(f"[main] process started in {MODE} mode")
async def healthcheck(request):
return JSONResponse({"status": "ok"})
# main starlette app object with ariadne mounted in root
app = Starlette(
on_startup=[
@ -37,6 +35,6 @@ app = Starlette(
on_shutdown=[redis.disconnect],
debug=True,
routes=[
Route('/', healthcheck, methods=['GET']),
Route("/", GraphQL(schema, debug=True)),
],
)