Netlify
Functions Commands
Build and deploy serverless functions on Netlify. Create API endpoints, background functions, and scheduled functions — all deployed alongside your site.
5 commands
Pro Tips
Use 'netlify functions:create' to scaffold a new function from templates — handles boilerplate setup.
Test locally with 'netlify dev' — it runs your functions at /.netlify/functions/ with hot reload.
Use 'netlify functions:invoke functionName --payload "{\"key\": \"value\"}"' to test functions from CLI.
Common Mistakes
Netlify Functions have a 10-second timeout on the free plan (26s on paid). Use background functions for longer tasks.
Don't store secrets in function code. Use 'netlify env:set' and access via process.env.