An Aspire integration for hosting Bun apps. DEPRECATED: Use Aspire.Hosting.JavaScript and builder.AddBunApp(...) instead. This package will be removed in a future release.
Install
| Product | Versions |
|---|---|
| .NET |
README
CommunityToolkit.Aspire.Hosting.Bun library
⚠️ DEPRECATION NOTICE
This package is deprecated. Bun support is now available in the coreAspire.Hosting.JavaScriptpackage viaAddBunApp(...).Migration Guide:
- Install
Aspire.Hosting.JavaScriptand removeCommunityToolkit.Aspire.Hosting.Bun.- Review existing
builder.AddBunApp(...)calls carefully: if you pass arguments positionally, you may need to reorder them or convert them to named arguments when moving to the core package implementation.- If you're using TypeScript AppHost bindings, continue using
builder.addBunApp(...)from the generated core bindings.This package will be removed in a future release. Please migrate to
Aspire.Hosting.JavaScript.
Provides extension methods and resource definitions for an Aspire AppHost to configure a Bun project.
Getting Started
Install the package
In your AppHost project, install the package using the following command:
dotnet add package CommunityToolkit.Aspire.Hosting.Bun
Example usage
Then, in the Program.cs file of AppHost, define a Bun resource, then call AddBunApp:
builder.AddBunApp("bun-server", "main.ts")
.WithHttpEndpoint(env: "PORT")
.WithEndpoint();
Migration from Toolkit Bun to core Bun
Toolkit API:
builder.AddBunApp("api", "server.ts")
.WithHttpEndpoint(env: "PORT");
Core API (Aspire.Hosting.JavaScript):
builder.AddBunApp("api", "./api", "server.ts")
.WithHttpEndpoint(env: "PORT")
.WithExternalHttpEndpoints();
TypeScript AppHost (core bindings):
await builder
.addBunApp("api", "./api", "server.ts")
.withHttpEndpoint({ env: "PORT" })
.withExternalHttpEndpoints();
Additional Information
https://learn.microsoft.com/dotnet/aspire/community-toolkit/hosting-bun
Feedback & contributing
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.