Spaces:
Sleeping
Sleeping
Commit ·
4e60cba
1
Parent(s): f2c0913
final6
Browse files- api/index.py +14 -0
- vercel.json +4 -4
api/index.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Vercel serverless entrypoint.
|
| 2 |
+
|
| 3 |
+
Exposes the existing Flask `app` from project root using the `api/` layout
|
| 4 |
+
required by Vercel Python runtime.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import sys
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
|
| 10 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 11 |
+
if str(ROOT) not in sys.path:
|
| 12 |
+
sys.path.insert(0, str(ROOT))
|
| 13 |
+
|
| 14 |
+
from app import app # noqa: E402,F401
|
vercel.json
CHANGED
|
@@ -3,19 +3,19 @@
|
|
| 3 |
"routes": [
|
| 4 |
{
|
| 5 |
"src": "/(.*\\.(?:css|js|svg|png|jpg|jpeg|ico|webp|gif|json|txt|pdf|md|woff2?))",
|
| 6 |
-
"dest": "
|
| 7 |
},
|
| 8 |
{
|
| 9 |
"src": "/api/(.*)",
|
| 10 |
-
"dest": "
|
| 11 |
},
|
| 12 |
{
|
| 13 |
"src": "/(.*)",
|
| 14 |
-
"dest": "
|
| 15 |
}
|
| 16 |
],
|
| 17 |
"functions": {
|
| 18 |
-
"
|
| 19 |
"maxDuration": 60,
|
| 20 |
"memory": 1024
|
| 21 |
}
|
|
|
|
| 3 |
"routes": [
|
| 4 |
{
|
| 5 |
"src": "/(.*\\.(?:css|js|svg|png|jpg|jpeg|ico|webp|gif|json|txt|pdf|md|woff2?))",
|
| 6 |
+
"dest": "api/index.py"
|
| 7 |
},
|
| 8 |
{
|
| 9 |
"src": "/api/(.*)",
|
| 10 |
+
"dest": "api/index.py"
|
| 11 |
},
|
| 12 |
{
|
| 13 |
"src": "/(.*)",
|
| 14 |
+
"dest": "api/index.py"
|
| 15 |
}
|
| 16 |
],
|
| 17 |
"functions": {
|
| 18 |
+
"api/index.py": {
|
| 19 |
"maxDuration": 60,
|
| 20 |
"memory": 1024
|
| 21 |
}
|