I don't care about one over another, but I would prefer if all examples followed the same approach. It would make the comparison more valuable.
I don't care about one over another, but I would prefer if all examples followed the same approach. It would make the comparison more valuable.
Personally I think a more real world method would have been to use the most popular web server framework for the given language. Someone else already commented that the Swift example would never do it this way in a real application.
var app = WebApplication.Create();
app.MapGet("/people", () => new[] { new Person("Ana"), new Person("Filipe"), new Person("Emillia") });
app.Run();
record Person(string Name);
The above (struggling to find the backtick on my Mobile keyboard) is straight from the ASP.NET website: https://dotnet.microsoft.com/en-us/apps/aspnet/apis
In any case - https://github.com/begoon/http-server/pull/1
But it's still valuable to know which languages support this out-of-the-box, perhaps.