# AddNxApp

- Module: [CommunityToolkit.Aspire.Hosting.JavaScript.Extensions](/reference/api/go/communitytoolkit.aspire.hosting.javascript.extensions.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Adds an Nx monorepo workspace to the distributed application builder.

## Definition

```go
func (DistributedApplicationBuilder) AddNxApp(
    name string,
    options ...*AddNxAppOptions,
) NxResource
```

## Parameters

- `name` (`string`) -- The name of the Nx workspace resource.
- `options` (`...*AddNxAppOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddNxAppOptions` argument.

- `WorkingDirectory` (`*string`) -- The working directory of the Nx workspace. If not specified, it will be set to a path that is a sibling of the AppHost directory using the `name` as the folder.

## Returns

[`NxResource`](/reference/api/go/communitytoolkit.aspire.hosting.javascript.extensions/nxresource.md) -- A reference to the `IResourceBuilder`.

Returns a handle; failures surface later via `Err()`.

## Applies to

- `DistributedApplicationBuilder`
