Skip to content

Commit b25b0c3

Browse files
committed
fix: thin wrapper api/roast.py at root for Vercel Python detection
1 parent 3f72914 commit b25b0c3

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎api/roast.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Vercel serverless function: re-exports handler from web/api/roast.py."""
2+
import importlib.util
3+
import os
4+
import sys
5+
6+
# Load web/api/roast.py as a module (no __init__.py needed)
7+
_spec = importlib.util.spec_from_file_location(
8+
"web_api_roast",
9+
os.path.join(os.path.dirname(__file__), "..", "web", "api", "roast.py"),
10+
)
11+
_mod = importlib.util.module_from_spec(_spec)
12+
_spec.loader.exec_module(_mod)
13+
14+
handler = _mod.handler # noqa: F841

‎vercel.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"buildCommand": "cd web && npm run build",
55
"outputDirectory": "web/.next",
66
"functions": {
7-
"web/api/roast.py": {
7+
"api/roast.py": {
88
"maxDuration": 60
99
}
1010
},
1111
"rewrites": [
1212
{
1313
"source": "/api/:path*",
14-
"destination": "/web/api/roast.py"
14+
"destination": "/api/roast.py"
1515
}
1616
]
1717
}

‎web/__init__.py‎

Whitespace-only changes.

‎web/api/__init__.py‎

Whitespace-only changes.

0 commit comments

Comments
 (0)