3 ms·
I wondered this too. Personally, as someone that enjoys using C# a lot I was somewhat surprised it's example went with a plain HttpListener like that. But, that
by MortyWaves 2y ago
I wondered this too. Personally, as someone that enjoys using C# a lot I was somewhat surprised it's example went with a plain HttpListener like that. But, that seems to be the general theme of all the examples there.
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.
- cpfohl 2y agoSame thought! Python uses FastAPI. C# with ASP.NET looks similarly terse, and ASP.NET is “built in” (kinda). 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 https://dotnet.microsoft.com/en-us/apps/aspnet/apis
- neonsunset 2y agoFor some reason the repo uses outdated Mono (which is limited to ancient .NET Framework APIs and old C# version) which could be the culprit. In any case - https://github.com/begoon/http-server/pull/1 https://github.com/begoon/http-server/pull/1