The documentation for deploying functions using a “file digest method” is extremely poor. I’ve followed the steps in the documentation exactly with no success. There’s clearly some weird undocumented behaviour going on, so I’m coming to you to ask for some support.
- Get checksum
sha256sum api.js | cut -d " " -f 1
- Write to JSON
{
"functions": { "api": "<>" }
}
- Create a new site
curl -X POST -H "Authorization: Bearer <>" "https://api.netlify.com/api/v1/sites"
- Create a new deploy
curl -X POST --json "@digest.json" -H "Authorization: Bearer <>" "https://api.netlify.com/api/v1/sites/<site_id>/deploys" | jq
- Zip the function
zip api.zip api.js
- PUT to functions endpoint
curl -X PUT -H "Content-Type: application/octet-stream" --data-binary "@api.zip" -H "Authorization: Bearer <>" "https://api.netlify.com/api/v1/deploys/<deploy_id>/functions/api?runtime=js"
Result: {“code”:500,“message”:“No records matched”}
Any advice on how to fix this would really help.