Content-Length: 279105 | pFad | http://github.com/NikiforovAll/minimal-api-example

42 GitHub - NikiforovAll/minimal-api-example: Modular Minimal API in .NET 6
Skip to content

NikiforovAll/minimal-api-example

Repository files navigation

Modular Minimal API in .NET 6

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

Build and Run

Clone the repository and enter dotnet run.

Demo

Please see assets/run.http for more details.

alt

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NikiforovAll/minimal-api-example

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy