Skip to content

Commit 9b998da

Browse files
committed
Added support for debugging Node.js code
1 parent e19f0c0 commit 9b998da

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/JavaScriptViewEngine/NodeRenderEngine.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ public NodeRenderEngine(IServiceProvider serviceProvider, NodeRenderEngineOption
3232
{
3333
ProjectPath = options.ProjectDirectory,
3434
WatchFileExtensions = options.WatchFileExtensions,
35-
EnvironmentVariables = options.EnvironmentVariables
35+
EnvironmentVariables = options.EnvironmentVariables,
36+
DebuggingPort = options.DebuggingPort,
37+
LaunchWithDebugging = options.LaunchWithDebugging
3638
};
3739

3840
if (options.NodeInstanceFactory != null)

src/JavaScriptViewEngine/NodeRenderEngineOptions.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,17 @@ public NodeRenderEngineOptions()
5656
/// If set, starts the Node.js instance with the specified environment variables.
5757
/// </summary>
5858
public IDictionary<string, string> EnvironmentVariables { get; set; }
59-
}
59+
60+
/// <summary>
61+
/// If true, the Node.js instance will accept incoming V8 debugger connections (e.g., from node-inspector).
62+
/// </summary>
63+
public bool LaunchWithDebugging { get; set; }
64+
65+
/// <summary>
66+
/// If <see cref="LaunchWithDebugging"/> is true, the Node.js instance will listen for V8 debugger connections on this port.
67+
/// </summary>
68+
public int DebuggingPort { get; set; }
69+
}
6070

6171
public delegate string GetModuleNameDelegate(string path, object model, dynamic viewBag, RouteValueDictionary routeValues, string area, ViewType viewType);
6272
}

0 commit comments

Comments
 (0)