diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-05-03 09:59:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-03 09:59:57 -0500 |
| commit | 09adf4655f43ab6abeba1d1ac219df94d70c634c (patch) | |
| tree | 06c3f12f92f1174eef8548e5d39b0f0e23d4ad7d /src/slskd/Core/API | |
| parent | 8ac38c8065763443dd84c5eafafe8a372de3e9db (diff) | |
| parent | 12f2aded2257a7dcc9dbb00cbbd8bafc28579ad4 (diff) | |
| download | slskd-09adf4655f43ab6abeba1d1ac219df94d70c634c.tar.gz | |
Merge pull request #450 from slskd/routing
Fix bug preventing routes with more than one segment from working
Diffstat (limited to 'src/slskd/Core/API')
| -rw-r--r-- | src/slskd/Core/API/Controllers/ApplicationController.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index 19360fe1..9f38a17f 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> +using Microsoft.Extensions.Options; + namespace slskd.Core.API { using System; @@ -37,15 +39,18 @@ namespace slskd.Core.API public ApplicationController( IHostApplicationLifetime lifetime, IApplication application, + IOptionsMonitor<Options> optionsMonitor, IStateMonitor<State> applicationStateMonitor) { Lifetime = lifetime; Application = application; + OptionsMonitor = optionsMonitor; ApplicationStateMonitor = applicationStateMonitor; } private IApplication Application { get; } private IStateMonitor<State> ApplicationStateMonitor { get; } + private IOptionsMonitor<Options> OptionsMonitor { get; } private IHostApplicationLifetime Lifetime { get; } /// <summary> @@ -146,5 +151,11 @@ namespace slskd.Core.API return Ok(); } + + [HttpGet("urlbase")] + public IActionResult GetUrlBase() + { + return Ok(OptionsMonitor.CurrentValue.Web.UrlBase); + } } } |
