bagaseptian commited on
Commit
ffd2f51
·
1 Parent(s): c4c36f8

test endpoint

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. app_test_hf.py +16 -0
app.py CHANGED
@@ -91,7 +91,7 @@ async def get_latest_backend_url_from_github():
91
  @app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
92
  async def proxy_to_backend(request: Request, path: str):
93
  """
94
- Menerima semua request dan memroxy ke backend Colab.
95
  """
96
  backend_url = await get_latest_backend_url_from_github()
97
 
 
91
  @app.api_route("/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
92
  async def proxy_to_backend(request: Request, path: str):
93
  """
94
+ Menerima semua request dan memproxy ke backend Colab.
95
  """
96
  backend_url = await get_latest_backend_url_from_github()
97
 
app_test_hf.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ import logging
3
+
4
+ logging.basicConfig(level=logging.INFO)
5
+ logger = logging.getLogger(__name__)
6
+
7
+ app = FastAPI()
8
+
9
+ @app.get("/")
10
+ async def root_test():
11
+ logger.info("Root endpoint/ akses")
12
+ return{"message": "Hello hf"}
13
+ @app.get("/test-hf")
14
+ async def test_endpoint():
15
+ logger.info("berhasil akses endpont /test-hf")
16
+ return {"message": "Test endpoint workk!"}