Introduction to REST APIs in NestJS
Remember how we kicked things off in Chapter 3 by crafting a simple NestJS application? Well, now it’s time to peel back another layer. We were able to make a GET request to the application programming interface (API) we created back then because, by default, NestJS supports the REpresentational State Transfer (REST) architectural style.
So, what’s this REST thing, anyway? And how’s it different from being RESTful? This question may have arisen as you read this paragraph, and it’s great as it calls out your curiosity! Think of REST as more than a set of tools; it’s a philosophy for designing applications that communicate over a network. It’s all about simplicity, using stateless operations, and providing a uniform way to address resources, often over our good old friend, HTTP. On the flip side, when we talk about something being RESTful, we’re referring to an API that’s a walking, talking...