Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithHttpEndpoint

Method
📦 Aspire.Hosting v17.0.0
func (ResourceWithEndpoints) WithHttpEndpoint(options ...*WithHttpEndpointOptions) ResourceWithEndpoints

Signature

methodWithHttpEndpointbuilder
Adds an HTTP endpoint
WithHttpEndpoint(options ...*WithHttpEndpointOptions) ResourceWithEndpoints
options...*WithHttpEndpointOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithHttpEndpointOptions argument.

Port*float64An optional port. This is the port that will be given to other resource to communicate with this resource.
TargetPort*float64This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
Name*stringAn optional name of the endpoint. Defaults to "http" if not specified.
Env*stringAn optional name of the environment variable to inject.
IsProxied*boolSpecifies if the endpoint will be proxied by DCP. Defaults to null.
ResourceWithEndpoints

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: