Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddJavaScriptApp

Method
📦 Aspire.Hosting.JavaScript v17.0.0
func (DistributedApplicationBuilder) AddJavaScriptApp(
name string,
appDirectory string,
options ...*AddJavaScriptAppOptions,
) JavaScriptAppResource

Signature

methodAddJavaScriptAppbuilder
Adds a JavaScript application resource to the distributed application using the specified app directory and run script.
AddJavaScriptApp(
name string,
appDirectory string,
options ...*AddJavaScriptAppOptions,
) JavaScriptAppResource
namestringThe unique name of the JavaScript application resource. Cannot be null or empty.
appDirectorystringThe path to the directory containing the JavaScript application.
options...*AddJavaScriptAppOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddJavaScriptAppOptions argument.

RunScriptName*stringThe name of the npm script to run when starting the application. Defaults to "dev". Cannot be null or empty.
JavaScriptAppResource

A resource builder for the newly added JavaScript application resource.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types:

typeDistributedApplicationBuilder