diff --git a/src/ViteProxy.csproj b/src/ViteProxy.csproj index c00cea8..2927c84 100644 --- a/src/ViteProxy.csproj +++ b/src/ViteProxy.csproj @@ -1,11 +1,11 @@  - net6.0 + net6.0;net7.0;net8.0;net9.0;net10.0 enable ViteProxy ViteProxy - 1.1.1 + 1.2.0 diff --git a/src/ViteProxyOptions.cs b/src/ViteProxyOptions.cs index 9eabe70..739f6db 100644 --- a/src/ViteProxyOptions.cs +++ b/src/ViteProxyOptions.cs @@ -15,7 +15,7 @@ public class ViteProxyOptions /// /// Directory where the frontend files are located /// - public string WorkingDirectory { get; set; } = ""; + public string WorkingDirectory { get; set; } = "App"; /// /// Whether to enable the proxy or not diff --git a/src/ViteProxyService.cs b/src/ViteProxyService.cs index b4460ea..fdd3980 100644 --- a/src/ViteProxyService.cs +++ b/src/ViteProxyService.cs @@ -81,6 +81,7 @@ public class ViteProxyService : IHostedService ProcessProxy process = new ProcessProxy(_workingDirectory.Path, "npm", _options.ForwardLog) .Argument("run " + _options.ScriptName) .EnvVar("PORT", port.ToString()) + //.EnvVar("URL_PREFIX", "/@viteproxy/") .Capture(CaptureLog); await process.RunAsync(_options.StartupCondition, TimeSpan.FromSeconds(_options.TimeoutInSeconds)); diff --git a/src/ViteProxyServiceCollectionExtensions.cs b/src/ViteProxyServiceCollectionExtensions.cs index 9177bc7..125d9f7 100644 --- a/src/ViteProxyServiceCollectionExtensions.cs +++ b/src/ViteProxyServiceCollectionExtensions.cs @@ -8,23 +8,23 @@ namespace ViteProxy; public static class ViteProxyServiceCollectionExtensions { - public static IServiceCollection AddViteProxy(this IServiceCollection services) + public static IServiceCollection AddViteProxy(this IServiceCollection services, string configSectionPath = "Vite") { services.AddLogging(); services.AddOptions(); services.AddHostedService(); - services.AddOptions().BindConfiguration("Vite"); + services.AddOptions().BindConfiguration(configSectionPath); return services; } - public static IServiceCollection AddViteProxy(this IServiceCollection services, Action configure) + public static IServiceCollection AddViteProxy(this IServiceCollection services, Action configure, string configSectionPath = "Vite") { services.AddLogging(); services.AddOptions(); services.AddHostedService(); - services.AddOptions().BindConfiguration("Vite"); + services.AddOptions().BindConfiguration(configSectionPath); services.PostConfigure(configure); return services;