I have a very simple app, it’s just a static html file. When deploying as a drag-and-drop browser, it deploys and renders file. However, when deploying it as a ZIP through the API. The upload is successful, extraction is successful, but the webpage renders at a text file of html, instead of html.
The “successful” deploy can be viewed here.
https://61ea241fa5e1305687d3d6a5--p99pop.netlify.app/
Does anyone have any idea whats happened?
Here is the python code used to deploy the zip file
headers = {
"Content-Type": "application/zip",
"Authorization": "Bearer " + token
}
shutil.make_archive('web', 'zip', './web')
# Open the zip file just created, and read the binary contents
data = open('web.zip','rb').read()
url = f"https://api.netlify.com/api/v1/sites/{siteId}/deploys"
# Using requests library, post the binary data
r = requests.request('POST', url, headers=headers, data=data)
os.remove('web.zip')