seawolf2357 commited on
Commit
b5828c5
ยท
verified ยท
1 Parent(s): 43987c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -20
app.py CHANGED
@@ -767,37 +767,25 @@ def deploy_to_vercel(code: str):
767
  project_name = ''.join(random.choice(string.ascii_lowercase) for i in range(6))
768
 
769
  # Vercel API ์—”๋“œํฌ์ธํŠธ
770
- api_url = "https://api.vercel.com/v9/projects"
771
  deploy_url = "https://api.vercel.com/v13/deployments"
772
 
773
- # ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
774
  headers = {
775
  "Authorization": f"Bearer {token}",
776
  "Content-Type": "application/json"
777
  }
778
-
779
- # framework ํ•„๋“œ ์ œ๊ฑฐ
780
- project_data = {
781
- "name": project_name
782
- }
783
-
784
- project_response = requests.post(api_url, headers=headers, json=project_data)
785
-
786
- if project_response.status_code != 200:
787
- return f"ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์‹คํŒจ: {project_response.text}"
788
 
789
- # ํŒŒ์ผ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ
790
- files = [{
791
- "file": "index.html",
792
- "data": code,
793
- "encoding": "utf-8"
794
- }]
795
 
796
- # ๋ฐฐํฌ ์š”์ฒญ ๋ฐ์ดํ„ฐ (framework ํ•„๋“œ ์ œ๊ฑฐ)
797
  deploy_data = {
798
  "name": project_name,
799
  "files": files,
800
- "projectId": project_response.json()["id"],
801
  "target": "production"
802
  }
803
 
 
767
  project_name = ''.join(random.choice(string.ascii_lowercase) for i in range(6))
768
 
769
  # Vercel API ์—”๋“œํฌ์ธํŠธ
 
770
  deploy_url = "https://api.vercel.com/v13/deployments"
771
 
772
+ # ํ—ค๋” ์„ค์ •
773
  headers = {
774
  "Authorization": f"Bearer {token}",
775
  "Content-Type": "application/json"
776
  }
 
 
 
 
 
 
 
 
 
 
777
 
778
+ # ๋ฐฐํฌํ•  ํŒŒ์ผ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ
779
+ files = {
780
+ "index.html": {
781
+ "content": code
782
+ }
783
+ }
784
 
785
+ # ๋ฐฐํฌ ์š”์ฒญ ๋ฐ์ดํ„ฐ (projectId ์ œ๊ฑฐ)
786
  deploy_data = {
787
  "name": project_name,
788
  "files": files,
 
789
  "target": "production"
790
  }
791