Chapter 6. Serving Our First HTML Document
Serving an HTML Template
Before we build any abstractions or define an API, let’s start with serving an HTML document based on a template, so we can familiarize ourselves with the server request/reply lifecycle. For this example and the rest that follow we will be using Nunjucks by Mozilla, which you can install as follows:
Now that we have Nunjucks installed we can create a template, src/index.html, with the contents shown in Example 6-1.
Example 6-1. Nunjucks HTML document template