Source for screencast: Episode 6 serving content in koajs with jade
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
public/js
test
.gitignore
Readme.md
example.js
package.json

Readme.md

Episode 6 – Serving Content in Koajs with Jade

Source files used in the Serving Content in Koajs with Jade screencast

In this episode we will learn how to serve static and dynamic content in Koajs with a deep dive into Jade's features and functions.

Koajs requires the node '--harmony' flag which enables the ES6 feature Generators, the foundational building block in Koajs.  There are many other features that are enabled when we use the '--harmony' flag such as the new variable keyword let. We'll use let in place of var through out the episode.

First we'll review the different types of responses that can be sent from Koajs and their default content types.

Then we will look at serving static content using the koa-static middleware.

Next we'll take a look at how to render dynamic content using co-views.

Co-views supports over 2 dozen templating engines by leveraging the node consolidate.js package.

I'll narrow down the list of templating engines to 3 unique and interesting choices:

We'll focus on the features and functionality of Jade in this episode, and we'll look at Swig and Marko in the next couple episodes.