BunAppExtensions Methods
ClassMethods2 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)extensionIResourceBuilder<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) { // ... }}Parameters
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to add the resource to.namestringThe name of the resource.workingDirectorystring?optionalThe working directory.entryPointstringoptionalThe entry point, either a file or package.json script name.watchbooloptionalWhether to watch for changes.Returns
IResourceBuilder<BunAppResource>A reference to the ApplicationModel.IResourceBuilder`1.WithBunPackageInstallation(IResourceBuilder<BunAppResource>, Action<IResourceBuilder<BunInstallerResource>>)Section titled WithBunPackageInstallation(IResourceBuilder<BunAppResource>, Action<IResourceBuilder<BunInstallerResource>>)extensionIResourceBuilder<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) { // ... }}Parameters
resourceIResourceBuilder<BunAppResource>The Bun app resource.configureInstallerAction<IResourceBuilder<BunInstallerResource>>optionalConfigure the Bun installer resource.Returns
IResourceBuilder<BunAppResource>A reference to the ApplicationModel.IResourceBuilder`1.Remarks
This overload is not available in polyglot AppHosts. Use
BunAppExtensions.WithBunPackageInstallation instead.