Chapter 2. Building a Web API

With the foundations in place, we begin the process of building a Web API for our Vision project. We will start by setting up a persistence layer using MongoDB. We will then implement, feature-by-feature, the various aspects of our Web API.

Persisting data with MongoDB and Mongoose

MongoDB is an open source document-oriented database system. MongoDB stores structured data such as JSON-like documents, simplifying integration.

Let's start by creating a MongoDB schema for our project. The schema contains some basic information related to the project such as the project's name, a GitHub access token, a user, and a list of repositories.

Let's install Mongoose, a MongoDB Object Document Mapper for Node.js; it provides a schema-based ...

Get Advanced Express Web Application Development 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.