Skip to content

Commit 6ae05b0

Browse files
committed
#22 bugfix: Check for development hosting environment instead of attached debugger
1 parent 2fa1034 commit 6ae05b0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Startup.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5858
name: "default",
5959
pattern: "{controller}/{action=Index}/{id?}");
6060

61-
endpoints.MapToVueCliProxy(
62-
"{*path}",
63-
new SpaOptions { SourcePath = "ClientApp" },
64-
npmScript: (System.Diagnostics.Debugger.IsAttached) ? "serve" : null,
65-
regex: "Compiled successfully");
61+
if (env.IsDevelopment())
62+
{
63+
endpoints.MapToVueCliProxy(
64+
"{*path}",
65+
new SpaOptions { SourcePath = "ClientApp" },
66+
npmScript: "serve",
67+
regex: "Compiled successfully");
68+
}
6669

6770
// Add MapRazorPages if the app uses Razor Pages. Since Endpoint Routing includes support for many frameworks, adding Razor Pages is now opt -in.
6871
endpoints.MapRazorPages();

0 commit comments

Comments
 (0)