NodeAppHostingExtension.AddNpmApp Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- builder
- IDistributedApplicationBuilder
The IDistributedApplicationBuilder to add the resource to.
- 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>.