feat: with Playground mounted on /
All checks were successful
deploy / deploy (push) Successful in 52s
All checks were successful
deploy / deploy (push) Successful in 52s
This commit is contained in:
parent
dbf1d8880d
commit
a774108b18
8
main.py
8
main.py
|
@ -4,8 +4,9 @@ from os.path import exists
|
||||||
|
|
||||||
from ariadne import load_schema_from_path, make_executable_schema
|
from ariadne import load_schema_from_path, make_executable_schema
|
||||||
from starlette.applications import Starlette
|
from starlette.applications import Starlette
|
||||||
|
from ariadne.asgi import GraphQL
|
||||||
|
|
||||||
from starlette.routing import Route
|
from starlette.routing import Route
|
||||||
from starlette.responses import JSONResponse
|
|
||||||
|
|
||||||
from services.rediscache import redis
|
from services.rediscache import redis
|
||||||
from services.schema import resolvers
|
from services.schema import resolvers
|
||||||
|
@ -24,9 +25,6 @@ async def start():
|
||||||
f.write(str(os.getpid()))
|
f.write(str(os.getpid()))
|
||||||
print(f"[main] process started in {MODE} mode")
|
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
|
# main starlette app object with ariadne mounted in root
|
||||||
app = Starlette(
|
app = Starlette(
|
||||||
on_startup=[
|
on_startup=[
|
||||||
|
@ -37,6 +35,6 @@ app = Starlette(
|
||||||
on_shutdown=[redis.disconnect],
|
on_shutdown=[redis.disconnect],
|
||||||
debug=True,
|
debug=True,
|
||||||
routes=[
|
routes=[
|
||||||
Route('/', healthcheck, methods=['GET']),
|
Route("/", GraphQL(schema, debug=True)),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user