Chapter 3. Creating an API

No matter how sophisticated your backend is, it will most likely be of no use unless you can make its services available to your clients in some way. The most common way to do so is through an Application Programming Interface (API)—a set of well-defined access methods for your backend. Through this, you allow clients to request data, perform calculations, and request other services offered by it.

In this chapter, we will look at how to construct such an API according to the widely used Representational State Transfer (REST) architecture. We will cover the theoretical basics of REST and then see how to implement its condensed version using Node.js according to our needs. We will round up by accessing the API via a REST client in order to see how it works in action.

Learning outcomes of the RESTful API

After reading this chapter, you will understand what a RESTful API is and how it is structured. You will also have gained a thorough understanding of how to define data access points in Node.js and work with these through a REST client.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.113.55