O'Reilly logo

Pro Express.js by Azat Mardan

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

CHAPTER 21

image

REST API

In this tutorial, we’ll build a RESTful API. In addition to Express.js, we’ll use MongoDB via the Mongoskin library. We’ll also use Mocha and SuperAgent to write functional tests.

This tutorial walks you through writing tests using the Mocha and SuperAgent libraries, and then shows you how to use the tests in a test-driven development manner to build a Node.js free-JSON REST API server, utilizing the Express.js framework and Mongoskin library for MongoDB.

Image Note  The full source code for both the test and app files is at https://github.com/azat-co/rest-api-express ...

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