# IResourceWithEndpoints.asHttp2Service

- 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`

Configures a resource to mark all endpoints' transport as HTTP/2. This is useful for HTTP/2 services that need prior knowledge.

## Definition

```typescript
interface IResourceWithEndpoints {
  // ... omitted for brevity
  asHttp2Service(): IResourceWithEndpoints;
}
```

## Signature

```typescript
asHttp2Service(): IResourceWithEndpoints
```

## Returns

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

## Defined on

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