HTTP Server
Baked uses ASP.NET Core's WebApplication to build and host a web application.
app.Layers.AddHttpServer();
Configuration Targets
HttpServer layer provides IAuthenticationCollection,
IMiddlewareCollection and IEndpointRouteBuilder targets to configure a web
application.
IAuthenticationCollection
This target is provided in AddServices phase. To configure it in a feature;
configurator.ConfigureAuthenticationCollection(authentications =>
{
...
});
IMiddlewareCollection
This target is provided in Build phase as the first target. To configure it in
a feature;
configurator.ConfigureMiddlewareCollection(middlewares =>
{
...
});
IEndpointRouteBuilder
This target is provided in Build phase right after IMiddlewareCollection. To
configure it in a feature;
configurator.ConfigureEndpointRouteBuilder(routes =>
{
...
});
Phases
This layer introduces following Start phases to the application it is added;
CreateBuilder: This phase is the earliest phase in an application which creates and adds aWebApplicationBuilderinstance to the application context along with aConfigurationManagerinstanceBuild: This phase adds all services from dependency injection layer to the services inWebApplicationBuilderinstance, then builds the app and addsWebApplicationandIServiceProviderinstances to the application contextRun: This phase is added to the application internally as the latest phase to run theWebApplication