Introduction

Completed

Building a web API is a common task. You want to be able to serve some data and know how an application or service consumes it. How you build the API might differ vastly between tech stacks. As part of building an API, you know there are parts like data storage, security, versioning, and documentation. Getting all these parts to work can be a complex undertaking.

Scenario: Build a prototype

You're a developer on a team. As part of your job, you build and maintain many APIs. You also experiment with new technologies to see if they're a good fit for your company's needs. You like frameworks that allow you to create an API with a few lines of code because an early result makes for a good conversation with colleagues and other stakeholders. You assume you can add more features later as the API grows in complexity.

What will you learn?

You'll learn how to build a so-called minimal API by using ASP.NET Core and .NET 8. As part of building your API, you'll add various route constructs to handle the reading and writing of data. You'll also add Swagger to ensure you have a way to document your API.

What is the main goal?

Build a powerful API that supports reading and writing with just a few lines of code.