windopper commited on
Commit
1287595
·
1 Parent(s): a87aea8

remove prepare-requirements.sh script and update vercel.json to include rewrites for API routing

Browse files
Files changed (4) hide show
  1. .vercelignore +10 -0
  2. api/index.py +3 -0
  3. prepare-requirements.sh +0 -12
  4. vercel.json +3 -2
.vercelignore ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Vercel이 uv 대신 pip를 사용하도록 uv 관련 파일 제외
2
+ # 이 파일들이 업로드되지 않으면 Vercel은 requirements.txt와 pip를 사용합니다
3
+ pyproject.toml
4
+ uv.lock
5
+ .venv
6
+ __pycache__
7
+ *.pyc
8
+ tests/
9
+ images/
10
+
api/index.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Vercel Serverless Function Entry Point
2
+ from server import app
3
+
prepare-requirements.sh DELETED
@@ -1,12 +0,0 @@
1
- #!/bin/bash
2
- # Git 의존성의 해시를 제거하여 Vercel 빌드 오류 방지
3
-
4
- # requirements.txt가 없으면 생성
5
- if [ ! -f requirements.txt ]; then
6
- uv pip compile pyproject.toml -o requirements.txt
7
- fi
8
-
9
- # Git 의존성 라인에서 해시 제거
10
- sed -i.bak 's/\(@ git+[^#]*\)#.*/\1/' requirements.txt 2>/dev/null || true
11
- rm -f requirements.txt.bak
12
-
 
 
 
 
 
 
 
 
 
 
 
 
 
vercel.json CHANGED
@@ -1,5 +1,6 @@
1
  {
2
- "buildCommand": "bash prepare-requirements.sh && pip install --disable-pip-version-check --no-cache-dir -r requirements.txt",
3
- "installCommand": "bash prepare-requirements.sh && pip install --disable-pip-version-check --no-cache-dir -r requirements.txt"
 
4
  }
5
 
 
1
  {
2
+ "rewrites": [
3
+ { "source": "/(.*)", "destination": "/api" }
4
+ ]
5
  }
6