-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
35 lines (23 loc) · 749 Bytes
/
app.py
File metadata and controls
35 lines (23 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from flask import Flask
from api.auth.graphql_view import GraphQLAuthView
from api.schema.strawberry_schema import schema
app = Flask(__name__)
@app.route("/", methods=["GET"])
def home() -> tuple[str, int]:
return "<h1>Demo Flask App V2</h1>", 200
@app.route("/internal/healthcheck", methods=["GET"])
def internal_healthcheck() -> tuple[str, int]:
return "Hello World!", 200
@app.route("/external/healthcheck", methods=["GET"])
def external_healthcheck() -> tuple[str, int]:
return "Hello World!", 200
app.add_url_rule(
"/internal/graphql",
view_func=GraphQLAuthView.as_view(
"graphql",
schema=schema,
graphiql=True,
),
)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=6001)