summaryrefslogtreecommitdiffstats
path: root/server/src/Endpoints/Internal/Root/ReadConfigurationRoute.cs
blob: e0dcca39f33345c57e09e20290aa41933f480f42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace IOL.GreatOffice.Api.Endpoints.Internal.Root;

public class ReadConfigurationRoute : RouteBaseSync.WithoutRequest.WithActionResult
{
	private readonly VaultService _vaultService;

	public ReadConfigurationRoute(VaultService vaultService) {
		_vaultService = vaultService;
	}

	[AllowAnonymous]
	[HttpGet("~/_/configuration")]
	public override ActionResult Handle() {
		var config = _vaultService.GetCurrentAppConfiguration();
		return Content(JsonSerializer.Serialize(config.GetPublicVersion()), "application/json");
	}
}