From 1b17e1d8a4bf63bedbf1b62683acb30b6b0298f8 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 3 May 2022 08:54:01 -0500 Subject: add GET /urlbase --- src/slskd/Core/API/Controllers/ApplicationController.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/slskd/Core/API/Controllers/ApplicationController.cs') 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/. // +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 optionsMonitor, IStateMonitor applicationStateMonitor) { Lifetime = lifetime; Application = application; + OptionsMonitor = optionsMonitor; ApplicationStateMonitor = applicationStateMonitor; } private IApplication Application { get; } private IStateMonitor ApplicationStateMonitor { get; } + private IOptionsMonitor OptionsMonitor { get; } private IHostApplicationLifetime Lifetime { get; } /// @@ -146,5 +151,11 @@ namespace slskd.Core.API return Ok(); } + + [HttpGet("urlbase")] + public IActionResult GetUrlBase() + { + return Ok(OptionsMonitor.CurrentValue.Web.UrlBase); + } } } -- cgit v1.2.3