Book Image

Learning Node.js for Mobile Application Development

Book Image

Learning Node.js for Mobile Application Development

Overview of this book

Table of Contents (21 chapters)
Learning Node.js for Mobile Application Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
14
Creating an E-Commerce Application Using the Ionic Framework
Index

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.