Skip to content
Docs Try Aspire

BunAppExtensions Methods

Class Methods 2 members
Extension methods for adding a Bun app to a Hosting.IDistributedApplicationBuilder.
AddBunApp(IDistributedApplicationBuilder, string, string?, string, bool) Section titled AddBunApp(IDistributedApplicationBuilder, string, string?, string, bool) extension IResourceBuilder<BunAppResource>
Adds a Bun app to the builder.
public static class BunAppExtensions
{
public static IResourceBuilder<BunAppResource> AddBunApp(
this IDistributedApplicationBuilder builder,
string name,
string? workingDirectory = null,
string entryPoint = "index.ts",
bool watch = false)
{
// ...
}
}
builder IDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder to add the resource to.
name string The name of the resource.
workingDirectory string? optional The working directory.
entryPoint string optional The entry point, either a file or package.json script name.
watch bool optional Whether to watch for changes.
IResourceBuilder<BunAppResource> A reference to the ApplicationModel.IResourceBuilder`1.
WithBunPackageInstallation(IResourceBuilder<BunAppResource>, Action<IResourceBuilder<BunInstallerResource>>) Section titled WithBunPackageInstallation(IResourceBuilder<BunAppResource>, Action<IResourceBuilder<BunInstallerResource>>) extension IResourceBuilder<BunAppResource>
Ensures the Bun packages are installed before the application starts using Bun as the package manager.
public static class BunAppExtensions
{
public static IResourceBuilder<BunAppResource> WithBunPackageInstallation(
this IResourceBuilder<BunAppResource> resource,
Action<IResourceBuilder<BunInstallerResource>>? configureInstaller = null)
{
// ...
}
}
resource IResourceBuilder<BunAppResource> The Bun app resource.
configureInstaller Action<IResourceBuilder<BunInstallerResource>> optional Configure the Bun installer resource.
IResourceBuilder<BunAppResource> A reference to the ApplicationModel.IResourceBuilder`1.