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 ...

Get Pro Express.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.