共用方式為


NodeAppHostingExtension.AddNpmApp Method

Definition

Adds a node application to the application model. Executes the npm command with the specified script name.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.NodeAppResource> AddNpmApp (this Aspire.Hosting.IDistributedApplicationBuilder builder, string name, string workingDirectory, string scriptName = "start", string[]? args = default);
static member AddNpmApp : Aspire.Hosting.IDistributedApplicationBuilder * string * string * string * string[] -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.NodeAppResource>
<Extension()>
Public Function AddNpmApp (builder As IDistributedApplicationBuilder, name As String, workingDirectory As String, Optional scriptName As String = "start", Optional args As String() = Nothing) As IResourceBuilder(Of NodeAppResource)

Parameters

name
String

The name of the resource.

workingDirectory
String

The working directory to use for the command. If null, the working directory of the current process is used.

scriptName
String

The npm script to execute. Defaults to "start".

args
String[]

The arguments to pass to the command.

Returns

A reference to the IResourceBuilder<T>.

Applies to