Support new config options to launch the Node process with a debug listener. This is compatible with node-inspector.

This commit is contained in:
SteveSandersonMS
2016-07-26 18:33:27 +01:00
parent 79872c1bde
commit f2f67fe880
5 changed files with 60 additions and 13 deletions

View File

@@ -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);
}

View File

@@ -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; }
}
}