Smallest C# WebAPI

cloud-and-code Feb 5, 2025
var app = WebApplication.Create();

app.MapGet("helloworld", () => "helloww");
app.MapGet("person", () => new Person("goncalo", 38));

app.Run();

Now you can send this request by your browser or postman to your localhost and it should return the above.

Tags