# EndpointReference

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.2.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface EndpointReference
  extends IManifestExpressionProvider,
    IValueProvider,
    IValueWithReferences {
  readonly endpointName: string;
  errorMessage: string;
  readonly exists: boolean;
  readonly host: string;
  readonly isAllocated: boolean;
  readonly isHttp: boolean;
  readonly isHttps: boolean;
  readonly port: number;
  readonly resource: IResourceWithEndpoints;
  readonly scheme: string;
  readonly targetPort: number;
  readonly tlsEnabled: boolean;
  readonly url: string;
  getTlsValue(
      enabledValue: ReferenceExpression,
      disabledValue: ReferenceExpression): ReferenceExpression;
  getValueAsync(cancellationToken?: cancellationToken): string;
}
```

## Properties

- `endpointName`: `string` `get` -- Gets the EndpointName property
- `errorMessage`: `string` `get - set` -- Gets the ErrorMessage property
- `exists`: `boolean` `get` -- Gets the Exists property
- `host`: `string` `get` -- Gets the Host property
- `isAllocated`: `boolean` `get` -- Gets the IsAllocated property
- `isHttp`: `boolean` `get` -- Gets the IsHttp property
- `isHttps`: `boolean` `get` -- Gets the IsHttps property
- `port`: `number` `get` -- Gets the Port property
- `resource`: [IResourceWithEndpoints](/reference/api/typescript/aspire.hosting/iresourcewithendpoints.md) `get` -- Gets the Resource property
- `scheme`: `string` `get` -- Gets the Scheme property
- `targetPort`: `number` `get` -- Gets the TargetPort property
- `tlsEnabled`: `boolean` `get` -- Gets the TlsEnabled property
- `url`: `string` `get` -- Gets the Url property

## Methods

- [getTlsValue](/reference/api/typescript/aspire.hosting/endpointreference/gettlsvalue.md) -- `method` -- Gets a conditional expression that resolves to the enabledValue when TLS is enabled on the endpoint, or to the disabledValue otherwise.
    ```typescript
  getTlsValue(enabledValue: ReferenceExpression, disabledValue: ReferenceExpression): ReferenceExpression
  ```
- [getValueAsync](/reference/api/typescript/aspire.hosting/endpointreference/getvalueasync.md) -- `method` -- Gets the URL of the endpoint asynchronously
    ```typescript
  getValueAsync(cancellationToken?: cancellationToken): string
  ```
