Todo application that shows you how to apply Modular Minimal API recommendations.
var builder = WebApplication.CreateBuilder(args);
builder.AddSerilog();
builder.AddSwagger();
builder.AddAuthentication();
builder.AddAuthorization();
builder.Services.AddCors();
builder.AddStorage();
builder.Services.AddCarter();
var app = builder.Build();
var environment = app.Environment;
app
.UseExceptionHandling(environment)
.UseSwaggerEndpoints(routePrefix: string.Empty)
.UseAppCors()
.UseAuthentication()
.UseAuthorization();
app.MapCarter();
app.Run();
$ tree ./Features
.
├── HomeModule.cs
└── TodosModule.cs
POST {{h}}/todos
Content-Type: application/json
{
"title": "Write blog post about minimal api"
}
GET {{h}}/todos
PUT {{h}}/todos/4/mark-complete
Clone the repository and enter dotnet run
.
Please see assets/run.http
for more details.