# AddDenoApp

- Module: [Aspire.Hosting.JavaScript](/reference/api/go/aspire.hosting.javascript.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Adds a Deno application to the application model. Deno should be available on the PATH.

## Remarks

In run mode this method executes the script directly using `deno run -A <script>`. Generated
containers use the more restrictive `deno run --allow-net --allow-env <script>` default. Deno
natively runs JavaScript and TypeScript files so no transpile step is required. Deno's built-in OpenTelemetry
integration is enabled via the `OTEL_DENO` environment variable, so traces, metrics, and logs flow to the
Aspire dashboard with no application-level SDK wiring.
The full Deno flag surface (granular permissions, `--config`/`--import-map`/`--lock`, unstable
features, `--watch`, inspector flags, script args, and the `run`/`task`/`serve` sub-command
modes) can be configured with the fluent `WithDeno*` methods (for example `WithDenoAllow`,
`WithDenoConfig`, `WithDenoUnstable`, `WithDenoServe`). Configuring any of
these fully replaces the default arg vector, so a Deno workload never has to fall back to `AddExecutable`.
If the application directory contains a `package.json`, `deno.json`, or `deno.jsonc` file, Deno will
be added as the default package manager. When publishing to a container, the default base image is
`denoland/deno:2.9.0` for both the build and runtime stages.

## Definition

```go
func (DistributedApplicationBuilder) AddDenoApp(
    name string,
    appDirectory string,
    scriptPath string,
) DenoAppResource
```

## Parameters

- `name` (`string`) -- The name of the resource.
- `appDirectory` (`string`) -- The path to the directory containing the Deno application.
- `scriptPath` (`string`) -- The path to the script (for example, `main.ts`) relative to `appDirectory` to run.

## Returns

[`DenoAppResource`](/reference/api/go/aspire.hosting.javascript/denoappresource.md) -- The resource builder.

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

## Applies to

- `DistributedApplicationBuilder`
