You are previewing Node Web Development.

Node Web Development

Cover of Node Web Development by David Herron Published by Packt Publishing
O'Reilly logo

Using Express to implement the Math Wizard

Now that we understand Connect, let's take the Math Wizard on its next evolutionary step with Express. Express is a web application framework built upon Connect (a middleware framework). This means that the focus of Express is on constructing an application, including providing a template system, where the focus of Connect is on web server infrastructure. The same team develops both Express and Connect so it shouldn't be surprising to learn the APIs are extremely similar.

For example, this is Hello World in Express:

var app = require('express').createServer();
app.get('/', function(req, res) {
  res.send('Hello, world!');

This should look similar to the code for Connect we went over in ...

The best content for your career. Discover unlimited learning on demand for around $1/day.