Spaces:
Sleeping
Sleeping
hashimotoa961 commited on
Commit 路
88a96d4
1
Parent(s): c5325ef
fix for fastapi + uvicorn
Browse files- app.py +16 -16
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -7,27 +7,27 @@ import logging
|
|
| 7 |
app = FastAPI()
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
#
|
| 15 |
-
#
|
| 16 |
-
#
|
| 17 |
-
#
|
| 18 |
-
#
|
| 19 |
-
#
|
| 20 |
-
#
|
| 21 |
-
#
|
| 22 |
-
#
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
|
| 26 |
|
| 27 |
# @app.get("/api/")
|
| 28 |
# @app.get("/")
|
| 29 |
# @app.get("/api/")
|
| 30 |
-
@app.get("/")
|
| 31 |
def api(device = None, app = None, message = None):
|
| 32 |
|
| 33 |
# 銈儵銈ゃ偄銉炽儓銇嬨倝銇儶銈偍銈广儓銉囥兗銈裤倰鍙栧緱
|
|
|
|
| 7 |
app = FastAPI()
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
+
@app.get("/")
|
| 11 |
+
def read_root():
|
| 12 |
+
print("Hello, World!")
|
| 13 |
+
logger.info("Hello, World!")
|
| 14 |
+
# endpoint = "https://q3m2jxhpqj.execute-api.us-east-2.amazonaws.com/default/AliveChecker-SignalReceiver"
|
| 15 |
+
# params = {
|
| 16 |
+
# "device": "hugging",
|
| 17 |
+
# "app": "test",
|
| 18 |
+
# "message": "Hello, World!",
|
| 19 |
+
# "endpoint": endpoint
|
| 20 |
+
# }
|
| 21 |
+
# response = requests.get(endpoint, params=params)
|
| 22 |
+
# print(response, response.text)
|
| 23 |
+
# logger.info(f"{response} {response.text}")
|
| 24 |
+
return {"message": "Hello, World!"}
|
| 25 |
|
| 26 |
|
| 27 |
# @app.get("/api/")
|
| 28 |
# @app.get("/")
|
| 29 |
# @app.get("/api/")
|
| 30 |
+
@app.get("/api/")
|
| 31 |
def api(device = None, app = None, message = None):
|
| 32 |
|
| 33 |
# 銈儵銈ゃ偄銉炽儓銇嬨倝銇儶銈偍銈广儓銉囥兗銈裤倰鍙栧緱
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
fastapi
|
|
|
|
| 2 |
uvicorn
|
| 3 |
requests
|
|
|
|
| 1 |
fastapi
|
| 2 |
+
flask
|
| 3 |
uvicorn
|
| 4 |
requests
|