withEndpoint
Method
interface ContainerResource { // ... omitted for brevity withEndpoint( port?: number, targetPort?: number, scheme?: string, name?: string, env?: string, isProxied?: boolean, isExternal?: boolean, protocol?: ProtocolType): IResourceWithEndpoints;}Signature
method
withEndpoint builderAdds a network endpoint
withEndpoint( port?: number, targetPort?: number, scheme?: string, name?: string, env?: string, isProxied?: boolean, isExternal?: boolean, protocol?: ProtocolType): IResourceWithEndpointsParameters
portnumberoptionalAn optional port. This is the port that will be given to other resource to communicate with this resource.targetPort numberoptionalThis is the port the resource is listening on. If the endpoint is used for the container, it is the container port.schemestringoptionalAn optional scheme e.g. (http/https). Defaults to the `protocol` argument if it is defined or "tcp" otherwise.namestringoptionalAn optional name of the endpoint. Defaults to the scheme name if not specified.envstringoptionalAn optional name of the environment variable that will be used to inject the `targetPort`. If the target port is null one will be dynamically generated and assigned to the environment variable.isProxied booleanoptionalSpecifies if the endpoint will be proxied by DCP. Defaults to `null`.isExternal booleanoptionalIndicates that this endpoint should be exposed externally at publish time.protocolProtocolType optionalNetwork protocol: TCP or UDP are supported today, others possibly in future.Returns
IResourceWithEndpoints Applies to
This method applies to the following types: