mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-24 10:40:23 +00:00
Support new config options to launch the Node process with a debug listener. This is compatible with node-inspector.
This commit is contained in:
@@ -68,10 +68,12 @@ namespace Microsoft.AspNetCore.NodeServices
|
||||
switch (options.HostingModel)
|
||||
{
|
||||
case NodeHostingModel.Http:
|
||||
return new HttpNodeInstance(options.ProjectPath, options.WatchFileExtensions, logger, /* port */ 0);
|
||||
return new HttpNodeInstance(options.ProjectPath, options.WatchFileExtensions, logger,
|
||||
options.LaunchWithDebugging, options.DebuggingPort, /* port */ 0);
|
||||
case NodeHostingModel.Socket:
|
||||
var pipeName = "pni-" + Guid.NewGuid().ToString("D"); // Arbitrary non-clashing string
|
||||
return new SocketNodeInstance(options.ProjectPath, options.WatchFileExtensions, pipeName, logger);
|
||||
return new SocketNodeInstance(options.ProjectPath, options.WatchFileExtensions, pipeName, logger,
|
||||
options.LaunchWithDebugging, options.DebuggingPort);
|
||||
default:
|
||||
throw new ArgumentException("Unknown hosting model: " + options.HostingModel);
|
||||
}
|
||||
|
||||
@@ -21,5 +21,7 @@ namespace Microsoft.AspNetCore.NodeServices
|
||||
public string ProjectPath { get; set; }
|
||||
public string[] WatchFileExtensions { get; set; }
|
||||
public ILogger NodeInstanceOutputLogger { get; set; }
|
||||
public bool LaunchWithDebugging { get; set; }
|
||||
public int? DebuggingPort { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user