Spaces:
Runtime error
Runtime error
Upload api\test.py with huggingface_hub
Browse files- api//test.py +18 -0
api//test.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def handler(request):
|
| 5 |
+
return {
|
| 6 |
+
"statusCode": 200,
|
| 7 |
+
"headers": {
|
| 8 |
+
"Content-Type": "application/json",
|
| 9 |
+
"Access-Control-Allow-Origin": "*",
|
| 10 |
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
| 11 |
+
"Access-Control-Allow-Headers": "Content-Type, Authorization"
|
| 12 |
+
},
|
| 13 |
+
"body": json.dumps({"message": "Test API route working", "status": "success"})
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# For Vercel Python API Routes, export the handler function
|
| 18 |
+
handler.__name__ = 'handler'
|