From cb8ff68d5e3d5f286676673c530e3a2ee3719772 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 16 Jun 2020 16:39:16 +0800 Subject: refactor(back): Fix #108 . --- Timeline/Startup.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'Timeline/Startup.cs') diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs index 2eb08f96..11b6fa9e 100644 --- a/Timeline/Startup.cs +++ b/Timeline/Startup.cs @@ -143,16 +143,9 @@ namespace Timeline { spa.Options.SourcePath = useMockFrontEnd ? "MockClientApp" : "ClientApp"; - if (!useMockFrontEnd && Environment.IsDevelopment()) + if (!useMockFrontEnd && (Configuration.GetValue(ApplicationConfiguration.UseProxyFrontEndKey) ?? false)) { - if (Configuration.GetValue(ApplicationConfiguration.FrontEndProxyOnlyKey) ?? false) - { - spa.UseProxyToSpaDevelopmentServer(new UriBuilder("http", "localhost", 3000).Uri); - } - else - { - SpaServices.SpaDevelopmentServerMiddlewareExtensions.UseSpaDevelopmentServer(spa, packageManager: "yarn", npmScript: "install-and-start", port: 3000); - } + spa.UseProxyToSpaDevelopmentServer(new UriBuilder("http", "localhost", 3000).Uri); } }); } -- cgit v1.2.3