Ir al contenido
DocsTry Aspire
DocsTry

Get started with Deno and Aspire

Esta página aún no está disponible en tu idioma.

⭐ Community Toolkit Deno logo

The Aspire Community Toolkit Deno hosting integration adds Deno scripts and tasks to your AppHost. Aspire starts the Deno process locally, shows it in the dashboard, and lets you connect it to the rest of your distributed application.

The integration is a hosting integration: install it in the AppHost, then model each application with an AddDenoApp / addDenoApp resource or an AddDenoTask / addDenoTask resource. The resource runs the local deno command. You configure its working directory, permissions, arguments, endpoints, environment variables, and health checks in the AppHost.

AddDenoApp runs a script with deno run; AddDenoTask runs a task from deno.json or deno.jsonc with deno task. Both resource types participate in service discovery and can be referenced by other resources.

Add CommunityToolkit.Aspire.Hosting.Deno to your AppHost. Then add a Deno task or script resource:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var app = builder.AddDenoTask(
name: "web",
workingDirectory: "../web",
taskName: "dev")
.WithHttpEndpoint(env: "PORT")
.WithHttpHealthCheck("/");
builder.Build().Run();

Have the Deno application listen on the endpoint environment variable. For example, grant the --allow-env permission when an application reads PORT.

Set up Deno apps in the AppHost