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>.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈