Last Updated: February 25, 2016
·
491
· uknowthen

Writing middleware in Koajs [Screencast]

In this episode we’ll learn to write middleware, the foundational building block for Koajs and Expressjs.

Of course the best way to learn programming is to make stuff,
so we’ll build a “Session Management Middleware”.

We’ll start off writing a few tests using mocha and supertest , then we’ll implement our Session Management Middleware first storing the session information in memory.

Next we’ll take a quick look at RethinkDB , a cool new open source database, that we’ll use to store our session information.

Lastly we’ll refactor our middleware to save our session information using RethinkDB.

http://knowthen.com/episode-4-writing-middleware-in-koajs/

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside