HAKOM.Http.Core.Net Assembly
Provides the core infrastructure for building and hosting HTTP services on top of ASP.NET Core and Kestrel.
Remarks
Section titled “Remarks”The HAKOM.Http.Core.Net assembly supplies a base class (Service)
that removes common boiler-plate from HTTP service implementations: configuration binding, logging,
compression, CORS, proxy header forwarding, SSL certificate loading and running the application as a
Windows service or systemd daemon are all handled out of the box.
Derive from Service (or its generic variant Service<TSettingsClass,TSettingsInterface> when the service has its own strongly-typed settings) and override the virtual lifecycle methods as needed.
public sealed class MyService : Service{ public override string Name => "MyService";
protected override void ConfigureMvc(IMvcBuilder mvcBuilder) { base.ConfigureMvc(mvcBuilder); mvcBuilder.AddPrefixedApplicationPart( typeof(MyService).Assembly, "api" ); }}await using MyService service = new();
await service.SetupAsync(args);await service.Run();- ContainerExtensions – registers IServiceInformation in the DI container.
- MvcBuilderExtensions – adds controllers with optional route prefixes.
- WebApplicationBuilderExtensions – enables running the host as a Windows service or systemd daemon.
- WebApplicationExtensions – applies CORS settings to the running application.
| Namespaces | |
|---|---|
| HAKOM.Http.Core.Net.Api | Contains the public API surface for building and configuring HAKOM HTTP services. |
| HAKOM.Http.Core.Net.Api.Exceptions | Contains exception types raised by the HTTP core infrastructure during service configuration and startup. |
| HAKOM.Http.Core.Net.Api.Extensions | Provides extension methods that simplify common HTTP service setup tasks. |
| HAKOM.Http.Core.Net.Api.Versioning |
Was this page helpful?Thanks for your feedback!