# NatsServerResource

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

## Definition

```typescript
interface NatsServerResource
  extends IComputeResource,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  entrypoint: string;
  readonly host: EndpointReferenceExpression;
  readonly name: string;
  passwordParameter: ParameterResource;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  shellExecution: boolean;
  readonly uriExpression: ReferenceExpression;
  userNameParameter: ParameterResource;
  readonly userNameReference: ReferenceExpression;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): NatsServerResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): NatsServerResource;
  withJetStream(): NatsServerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `entrypoint`: `string` `get - set` -- Gets the Entrypoint property
- `host`: `EndpointReferenceExpression` `get` -- Gets the Host property
- `name`: `string` `get` -- Gets the Name property
- `passwordParameter`: `ParameterResource` `get - set` -- Gets the PasswordParameter property
- `port`: `EndpointReferenceExpression` `get` -- Gets the Port property
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the PrimaryEndpoint property
- `shellExecution`: `boolean` `get - set` -- Gets the ShellExecution property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property
- `userNameParameter`: `ParameterResource` `get - set` -- Gets the UserNameParameter property
- `userNameReference`: `ReferenceExpression` `get` -- Gets the UserNameReference property

## Methods

- [withDataBindMount](/reference/api/typescript/aspire.hosting.nats/natsserverresource/withdatabindmount.md) -- `method` -- Mounts a host directory as the NATS data directory.
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): NatsServerResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.nats/natsserverresource/withdatavolume.md) -- `method` -- Adds a persistent data volume to the NATS resource.
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): NatsServerResource
  ```
- [withJetStream](/reference/api/typescript/aspire.hosting.nats/natsserverresource/withjetstream.md) -- `method` -- Configures the NATS resource to enable JetStream.
    ```typescript
  withJetStream(): NatsServerResource
  ```
