all-the-functions icon indicating copy to clipboard operation
all-the-functions copied to clipboard

Large example of function use cases and all event driven Netlify functions

All the functions

All the different types of functions!

Table of Contents

Click to expand
  • Setup
  • Development
  • Deployment
  • Functions list
  • Notes

Setup

Install the dependencies

npm install

Run the setup scripts

npm run setup

Development

netlify dev

Deployment

npm run deploy

Functions list

Functions
1-normal-function
2-async-function
3-dynamic-html-via-query-param
4-dynamic-html-via-path
5-handle-redirects
6-using-node-modules
7-set-cookie
8-protected-function
9-using-middleware
10-env-variables
11a-crud-create
11b-crud-read
11c-crud-update
11d-crud-delete
12-fetch-external-api

Notes


Function names must match folder names.


When adding a new function, the server must be stopped and then restarted for it to work.


Setting cookies via functions works on live sites but not locally