# IResourceWithEndpoints.onResourceEndpointsAllocated

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

Subscribes to the ResourceEndpointsAllocated event.

## Definition

```typescript
interface IResourceWithEndpoints {
  // ... omitted for brevity
  onResourceEndpointsAllocated(callback: (arg: ResourceEndpointsAllocatedEvent) => Promise<void>): IResourceWithEndpoints;
}
```

## Signature

```typescript
onResourceEndpointsAllocated(callback: (arg: ResourceEndpointsAllocatedEvent) => Promise<void>): IResourceWithEndpoints
```

## Parameters

- `callback` (`(arg: ResourceEndpointsAllocatedEvent) => Promise<void>`)

## Returns

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

## Defined on

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