How to Use Handlebars with Netlify Serverless Functions

Less code, faster results, easier maintenance

Jonathan Hsu
Code 85

--

Photo by Jon Tyson on Unsplash

Netlify Serverless Functions (or simply Functions for short) have been a game changer. Before, in order to build an HTML template, populate it with data, and have it be web-accessible required setting up some sort of server, such as ExpressJS or perhaps diving into something like React.

I always felt like the overhead required for this seemingly simple request never added up. Fortunately for us, Netlify Functions remove a majority of the initial burden and I’m here to take us the rest of the way.

After watching a variety of videos, reading message boards, and trying to understand documentation, I’ve finally connected the dots and had to share!

Scroll to the bottom to skip ahead. I have links to the starter repo as well as all the research resources that helped me along the way.

The Basics

Before we get started, let’s go over some basics if you’re unfamiliar with any or all of the technologies we’ll be using in this tutorial.

  • Netlify: A Platform-as-a-Service (PaaS) that has positioned itself as beginner-friendly and a leader in hosting JAMstack applications.
  • Functions: A Netlify feature that…

--

--