Skip to content

sockdrawermoney/netlify-functions-workshop

 
 

Repository files navigation

Netlify Functions Serverless Workshop

This repo will teach you the core concepts of using serverless functions with Netlify.

Table of Contents

Using this repo

After following the prerequisite setup steps, work from the lessons folders.

If you get stuck or want to look ahead checkout the lessons-code-complete directory for the completed code.

Repo directory structure:

|── /lessons                 ✅ Work from these files!
|── /lessons-code-complete   💡 Complete lesson answers
|── /_instructor             🙈 Ignore these files. For instructor updates
|── /_scripts                🙈 Ignore these files

Workshop Lessons

Core Concepts

Lesson Final Code
1 Hello World
Deploying Your First Endpoint
Complete Code
2 Dynamic Content
Rendering Dynamic Content
Complete Code
3 Using Environment Variables
Using environment variables
Complete Code
4 Using Dependancies
Using NPM dependencies
Complete Code
5 Authenication
Protecting Endpoints
Complete Code
6 Using A Database
Using a database
Complete Code
7 Using Middleware
Using Function middleware
Complete Code
8 Using Addons
Deploying Your First Endpoint
Complete Code
9 Using Cors
Adding CORS support
Complete Code
10 Testing Functions
Testing Serverless functions
Complete Code

Use Cases

Lesson Final Code
1 Rest Api
Using functions for REST APIs
Complete Code
2 Graphql
Using functions for GraphQL APIs
Complete Code
3 Redirects
Using functions for Dynamic Redirects
Complete Code
4 Setting Cookies
Using functions to set cookies
Complete Code
5 Fetching Data
Using functions to fetch external API data
Complete Code
6 Scraping
Using functions for web scraping
Complete Code
7 Sending Emails
Using functions for sending email
Complete Code
8 Sending Sms
Using functions for sending text messages
Complete Code
9 Event Driven Functions
Using Netlify Event Driven functions
Complete Code
10 Payment Processing
Using functions for Payment Processing
Complete Code
11 Handling Oauth
Handing OAuth Flows
Complete Code
12 Handling File Uploads
Using functions for uploading files
Complete Code
13 Returning Dynamic Images
Using functions for returning images
Complete Code

Helpful Tools

  • Postman - desktop app for quick & easy endpoint testing
  • NVM - Node version manager

Prerequisites & Setup Steps

  1. Install the latest LTS version of Node. How to install Node.

  2. Verify you have git on your machine

    Most machines come pre-loaded with git. 🎉

    To verify you have git, open up your terminal and run:

    which git

    This should return a path of where git is installed. If the command returns git not found, we will need to install git on your machine.

  3. Setup a Netlify account

    If you don't already have an Netlify account, let's get one setup.

    Click here to setup a free Netlify account

  4. Install Netlify CLI

    Open up your terminal and run:

    npm install netlify-cli -g
  5. Connect the Netlify CLI with your Netlify account

    Open up your terminal and run:

    netlify login
  6. Verify the Netlify CLI works on your machine

    Open up your terminal and run:

    netlify --help
    

    This should return the list of commands from the CLI tool.

Bonus setup:

  • Install postman for quick & easy testing of endpoints we deploy
  • It's also recommended that you use nvm (node version manager) just in case you need to change versions of node for the workshop.

Additional Learning materials

Netlify

Serverless

About

Netlify Serverless Functions Workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 65.3%
  • HTML 25.7%
  • CSS 9.0%