Let's create a simple REST API to replace our /posts route for our blog. The API will be able perform the create, read, update, and delete (CRUD) actions for blog posts for our web application. Express middleware can serve as a helpful, reusable layer for configuring our RESTful API to make sure that any future APIs we want to implement can be done in a consistent way.
Building REST APIs with Express
Getting ready
When working on developing REST APIs, it can be very useful to have a client other than your application handy for hitting API endpoints and checking the format of the response data. You can use anything from a simple curl command to a wide variety of REST API client applications to do this. For those unfamiliar...