What is Express?ĮxpressJS is one of the most popular HTTP server libraries for Node.js, which by default isn't as friendly for API development. Web APIs define what requests can be made to a component (for example, an endpoint to get a list of books), how to make them (for example, a GET request), and their expected responses. On a collection of data, like books for example, there are a few actions we'll need to perform frequently, which boil down to - Create, Read, Update and Delete (also known as CRUD Functionality).Īn API (Application Programming Interface), as the name suggests, is an interface that defines the interaction between different software components. Given that we typically build REST APIs to leverage with HTTP instead of other protocols, these operations correspond to HTTP methods like GET, POST, or PUT. It typically mandates resources on the web are represented in a text format (like JSON, HTML, or XML) and can be accessed or modified by a predetermined set of operations. REST (Representational State Transfer) is a standard architecture for building and communicating with web services. We will use a simple JavaScript array to store our data instead. In this guide, we are going to build a REST API to manage books with Node.js and Express.įor the sake of simplicity, we won't be using a database, so you don't need experience using one. They use HTTP request methods to facilitate the request-response cycle and typically transfer data using JSON, and more rarely - HTML, XML and other formats. REST APIs are an industry-standard way for web services to send and receive data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |