seawolf2357 commited on
Commit
b316cfb
·
verified ·
1 Parent(s): 74c1b61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -815,9 +815,10 @@ def deploy_to_vercel(code: str):
815
  "Content-Type": "application/json"
816
  }
817
 
 
818
  project_data = {
819
  "name": project_name,
820
- "framework": "static"
821
  }
822
 
823
  project_response = requests.post(api_url, headers=headers, json=project_data)
@@ -825,19 +826,20 @@ def deploy_to_vercel(code: str):
825
  if project_response.status_code != 200:
826
  return f"프로젝트 생성 실패: {project_response.text}"
827
 
828
- # index.html 파일 생성
829
- files = {
830
- "index.html": {
831
- "content": code
832
- }
833
- }
834
 
835
- # 배포 요청
836
  deploy_data = {
837
  "name": project_name,
838
  "files": files,
839
  "projectId": project_response.json()["id"],
840
- "target": "production"
 
841
  }
842
 
843
  deploy_response = requests.post(deploy_url, headers=headers, json=deploy_data)
 
815
  "Content-Type": "application/json"
816
  }
817
 
818
+ # 프로젝트 데이터 수정 - framework를 "other"로 설정
819
  project_data = {
820
  "name": project_name,
821
+ "framework": "other" # static 대신 other 사용
822
  }
823
 
824
  project_response = requests.post(api_url, headers=headers, json=project_data)
 
826
  if project_response.status_code != 200:
827
  return f"프로젝트 생성 실패: {project_response.text}"
828
 
829
+ # 파일 데이터 구조 수정
830
+ files = [{
831
+ "file": "index.html",
832
+ "data": code,
833
+ "encoding": "utf-8"
834
+ }]
835
 
836
+ # 배포 요청 데이터 수정
837
  deploy_data = {
838
  "name": project_name,
839
  "files": files,
840
  "projectId": project_response.json()["id"],
841
+ "target": "production",
842
+ "framework": "other"
843
  }
844
 
845
  deploy_response = requests.post(deploy_url, headers=headers, json=deploy_data)