Getting a List of Resources
Learn how to fetch data in a NestJS application.
We'll cover the following...
In this section, we’ll create our first endpoint. Just like a library catalog that visitors can browse, we’ll create a route to fetch books, allowing access to our virtual collection. Initially, we’ll store the list of books in memory, a temporary and quick solution. This approach allows us to establish the basic functionality before integrating TypeORM for database management.
Updating BooksController
As we mentioned earlier, our application will have a route to fetch a list of books. In line with HTTP standards, we’ll use the GET
HTTP method, ...