# IResourceWithEndpoints.withHttpEndpoint

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResourceWithEndpoints](/reference/api/typescript/aspire.hosting/iresourcewithendpoints.md)
- Version: `13.3.0`
- Kind: `method`

Adds an HTTP endpoint

## Definition

```typescript
interface IResourceWithEndpoints {
  // ... omitted for brevity
  withHttpEndpoint(
      port?: number,
      targetPort?: number,
      name?: string,
      env?: string,
      isProxied?: boolean): IResourceWithEndpoints;
}
```

## Signature

```typescript
withHttpEndpoint(
    port?: number,
    targetPort?: number,
    name?: string,
    env?: string,
    isProxied?: boolean): IResourceWithEndpoints
```

## Parameters

- `port` (`number`) `optional`
- `targetPort` (`number`) `optional`
- `name` (`string`) `optional`
- `env` (`string`) `optional`
- `isProxied` (`boolean`) `optional` `= True`

## Returns

[IResourceWithEndpoints](/reference/api/typescript/aspire.hosting/iresourcewithendpoints.md) `builder`

## Defined on

- [IResourceWithEndpoints](/reference/api/typescript/aspire.hosting/iresourcewithendpoints.md) -- `interface`
