# JavaScriptAppResource.WithMappedEndpointPort

- Module: [CommunityToolkit.Aspire.Hosting.JavaScript.Extensions](/reference/api/go/communitytoolkit.aspire.hosting.javascript.extensions.md)
- Defined on: [JavaScriptAppResource](/reference/api/go/communitytoolkit.aspire.hosting.javascript.extensions/javascriptappresource.md)
- Version: `13.6.1`
- Kind: `method`

Maps the endpoint port for the JavaScript app resource to the appropriate command line argument

## Definition

```go
type JavaScriptAppResource interface {
    // ... omitted for brevity
    WithMappedEndpointPort(options ...*WithMappedEndpointPortOptions) JavaScriptAppResource
}
```

## Signature

```go
WithMappedEndpointPort(options ...*WithMappedEndpointPortOptions) JavaScriptAppResource
```

## Parameters

- `options` (`...*WithMappedEndpointPortOptions`) -- optional settings, see [Options](#options)

## Options

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

- `EndpointName` (`*string`) -- The name of the endpoint to map. If not specified, it will use the first HTTP or HTTPS endpoint found.

## Returns

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

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

## Defined on

- [JavaScriptAppResource](/reference/api/go/communitytoolkit.aspire.hosting.javascript.extensions/javascriptappresource.md) -- `handle`
