App Start Up Pipeline

App startup in ASP.NET Core
Learn how the Startup class in ASP.NET Core configures services and the app's request pipeline.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/startup?view=aspnetcore-8.0

In the program.cs we have a builder and an application.

Builder allows you to specify services or middleware to use in your application.

builder.Build() creates an application, which you can use to register dependency injection, define minimal APIs.

The flow of the pipeline

using WebAll.Components;

var builder = WebApplication.CreateBuilder(args);

var app = builder.Build();

// Middleware
app.UseExceptionHandler("/Error");
app.UseStaticFiles();

// Endpoint
app.MapGet("/hi", () => "Hello!");

app.Run();

The above creates a pipeline like the following

HTTP Request
   ↓
[Middleware 1]  e.g., exception handler
   ↓
[Middleware 2]  e.g., static files
   ↓
[Routing/Endpoints]  MapGet/Controllers live here
   ↓
HTTP Response