Skip to content
Docs Try Aspire
Docs Try

IResourceWithEndpoints

Interface
📦 Aspire.Hosting v13.3.0
interface IResourceWithEndpoints {
asHttp2Service(): IResourceWithEndpoints;
getEndpoint(name: string): EndpointReference;
onResourceEndpointsAllocated(callback: (arg: ResourceEndpointsAllocatedEvent) => Promise<void>): IResourceWithEndpoints;
withEndpoint(
port?: number,
targetPort?: number,
scheme?: string,
name?: string,
env?: string,
isProxied?: boolean,
isExternal?: boolean,
protocol?: ProtocolType): IResourceWithEndpoints;
withEndpointCallback(endpointName: string, callback: (obj: EndpointUpdateContext) => Promise<void>, createIfNotExists?: boolean): IResourceWithEndpoints;
withExternalHttpEndpoints(): IResourceWithEndpoints;
withHttpCommand(
path: string,
displayName: string,
options?: HttpCommandExportOptions): IResourceWithEndpoints;
withHttpEndpoint(
port?: number,
targetPort?: number,
name?: string,
env?: string,
isProxied?: boolean): IResourceWithEndpoints;
withHttpEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpoints;
withHttpHealthCheck(
path?: string,
statusCode?: number,
endpointName?: string): IResourceWithEndpoints;
withHttpProbe(
probeType: ProbeType,
path?: string,
initialDelaySeconds?: number,
periodSeconds?: number,
timeoutSeconds?: number,
failureThreshold?: number,
successThreshold?: number,
endpointName?: string): IResourceWithEndpoints;
withHttpsEndpoint(
port?: number,
targetPort?: number,
name?: string,
env?: string,
isProxied?: boolean): IResourceWithEndpoints;
withHttpsEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpoints;
withMcpServer(
path?: string,
endpointName?: string): IResourceWithEndpoints;
}

Methods

method asHttp2Service builder
Configures resource for HTTP/2
asHttp2Service(): IResourceWithEndpoints
IResourceWithEndpoints
Gets an endpoint reference
getEndpoint(name: string): EndpointReference
name string
EndpointReference
Subscribes to the ResourceEndpointsAllocated event
onResourceEndpointsAllocated(callback: (arg: ResourceEndpointsAllocatedEvent) => Promise<void>): IResourceWithEndpoints
callback (arg: ResourceEndpointsAllocatedEvent) => Promise<void>
IResourceWithEndpoints
method withEndpoint builder
Adds a network endpoint
withEndpoint(
port?: number,
targetPort?: number,
scheme?: string,
name?: string,
env?: string,
isProxied?: boolean,
isExternal?: boolean,
protocol?: ProtocolType): IResourceWithEndpoints
port number optional
targetPort number optional
scheme string optional
name string optional
env string optional
isProxied boolean optional = True
isExternal boolean optional
protocol ProtocolType optional
IResourceWithEndpoints
method withEndpointCallback builder
Updates a named endpoint via callback
withEndpointCallback(endpointName: string, callback: (obj: EndpointUpdateContext) => Promise<void>, createIfNotExists?: boolean): IResourceWithEndpoints
endpointName string
callback (obj: EndpointUpdateContext) => Promise<void>
createIfNotExists boolean optional = True
IResourceWithEndpoints
Makes HTTP endpoints externally accessible
withExternalHttpEndpoints(): IResourceWithEndpoints
IResourceWithEndpoints
method withHttpCommand builder
Adds an HTTP resource command
withHttpCommand(
path: string,
displayName: string,
options?: HttpCommandExportOptions): IResourceWithEndpoints
path string
displayName string
options HttpCommandExportOptions optional
IResourceWithEndpoints
method withHttpEndpoint builder
Adds an HTTP endpoint
withHttpEndpoint(
port?: number,
targetPort?: number,
name?: string,
env?: string,
isProxied?: boolean): IResourceWithEndpoints
port number optional
targetPort number optional
name string optional
env string optional
isProxied boolean optional = True
IResourceWithEndpoints
Updates an HTTP endpoint via callback
withHttpEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpoints
callback (obj: EndpointUpdateContext) => Promise<void>
name string optional
createIfNotExists boolean optional = True
IResourceWithEndpoints
method withHttpHealthCheck builder
Adds an HTTP health check
withHttpHealthCheck(
path?: string,
statusCode?: number,
endpointName?: string): IResourceWithEndpoints
path string optional
statusCode number optional
endpointName string optional
IResourceWithEndpoints
method withHttpProbe builder
Adds an HTTP health probe to the resource
withHttpProbe(
probeType: ProbeType,
path?: string,
initialDelaySeconds?: number,
periodSeconds?: number,
timeoutSeconds?: number,
failureThreshold?: number,
successThreshold?: number,
endpointName?: string): IResourceWithEndpoints
probeType ProbeType
path string optional
initialDelaySeconds number optional
periodSeconds number optional
timeoutSeconds number optional
failureThreshold number optional
successThreshold number optional
endpointName string optional
IResourceWithEndpoints
method withHttpsEndpoint builder
Adds an HTTPS endpoint
withHttpsEndpoint(
port?: number,
targetPort?: number,
name?: string,
env?: string,
isProxied?: boolean): IResourceWithEndpoints
port number optional
targetPort number optional
name string optional
env string optional
isProxied boolean optional = True
IResourceWithEndpoints
Updates an HTTPS endpoint via callback
withHttpsEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpoints
callback (obj: EndpointUpdateContext) => Promise<void>
name string optional
createIfNotExists boolean optional = True
IResourceWithEndpoints
method withMcpServer builder
Configures an MCP server endpoint on the resource
withMcpServer(
path?: string,
endpointName?: string): IResourceWithEndpoints
path string optional = /mcp
endpointName string optional
IResourceWithEndpoints