
Learn how serverless functions with Netlify enable dynamic features with minimal code and no server setup. Use JavaScript to build features like hidden API keys and secure payments with Stripe.
Set up Naglfar to locate your functions and create a root functions folder. Define a basic Netlify function with exports.handler that returns a 200 response.
Create your first serverless function and fetch its response on the frontend using vanilla JavaScript and Axios to display data and handle errors.
Create a basic Netlify API function that imports an items array from assets and returns it as a JSON string, enabling a clean front-end data flow.
Fix CORS errors by adding access-control-allow-origin headers to Netlify functions, enabling data access from external apps and different servers after deployment.
Explore how to sign up for Airtable, create a workspace and bases, and structure tables from scratch, with tips on naming and collaboration, and avoiding empty rows during data fetching.
Hide sensitive values with environment variables in a dotenv file and keep the api key from the front end.
Create a Netlify serverless function to fetch a single product from Airtable using event.queryStringParameters.id, returning the product or a 400/404 error when missing or not found.
Learn to fetch and render a dynamic single product using a frontend call to a serverless product API, handle loading and errors, and display name, price, image, and description.
Combine multiple Airtable functions into a single Netlify serverless function, test product endpoints locally, handle ID-based queries and errors, and streamline deployment with environment variables.
Learn how http methods drive serverless interactions, including get, post, put, and delete. Read data, create resources, update, and delete as your operations—and log the http method from the event.
Use a put request to modify survey data on a serverless function via axios, sending id and vote, while handling responses with try-catch and showing a loading state.
Set up serverless functions and a weather front-end to fetch weather data using a post request to the weather function, handling city input, alerts, and errors.
Identify and enforce the post method in a serverless weather API, parse city from the request body, log and return the city, and respond with a 400 for non-post methods.
Build a weather app with a Netlify serverless function, calling the OpenWeatherMap API via axios. Handle errors and return city, country, temperature, feels like, and description to the frontend.
Learn to implement a front-end newsletter form that communicates with a Netlify serverless function, including form setup, loading state handling, and success or error feedback.
Set up a Netlify newsletter function to accept only post requests, extract the email from the body, and post it via Axios with auth headers, returning 201 on success.
Learn to set up a Netlify serverless function for email, validate post requests, and require name, email, subject, and message, returning 400 when values are missing.
Learn how to implement a Stripe payment flow in a Netlify serverless function, including setting up Stripe, handling post requests, calculating total amount, and returning a client secret.
Set up a react app with create react app, install dependencies, and configure Netlify serverless functions, including creating the functions folder, adjusting package scripts, and running local servers.
Welcome to Serverless Functions Course.
I guess let’s start by answering the most pressing question first. What is a serverless function and why should we care? So, here is the deal. There are times when our app needs a dynamic feature and even after that 20th google search, we inevitably come to realization that the only way do it, is by building and hosting our own server. A good example would be setting up a stripe payment flow. There is a better solution though.
Serverless Functions.
Ok, but what is a serverless function? Well, despite the name, serverless function actually does not mean that there is no server. What it simply means, is that someone else is responsible for maintaining it . We, as front-end developers only need to setup our desired functionality, and the cloud provider will take care of the rest. What also really cool, we can continue to use our favorite programming language – Javascript. Most cloud providers offer some solution of serverless functions but for this course we will hosting company by the name of Netlify. We will use Netlify because they offer generous free tier and make it very easy, to get up and running with serverless functions.
Here are the serverless functions examples/setups were are going to cover during the course.
- Basic “Hello World”
- Basic API (with local data)
- Complex API (with Airtable)
- Survey
- Open Weather API
- Newsletter
- Send Email / Submit Form
- Stripe Payment