O'Reilly logo

Node Web Development by David Herron

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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!');
});
app.listen(3000);

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required