From ed06ea6bc95843a9924dc30db1e038e4e36f5035 Mon Sep 17 00:00:00 2001 From: Christian Kratky Date: Fri, 19 Jul 2019 19:32:33 +0200 Subject: [PATCH] Add version information to MQTTnet.Server. --- .../Controllers/ServerController.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Source/MQTTnet.Server/Controllers/ServerController.cs diff --git a/Source/MQTTnet.Server/Controllers/ServerController.cs b/Source/MQTTnet.Server/Controllers/ServerController.cs new file mode 100644 index 0000000..cf53bba --- /dev/null +++ b/Source/MQTTnet.Server/Controllers/ServerController.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System.Reflection; + +namespace MQTTnet.Server.Controllers +{ + [Authorize] + [ApiController] + public class ServerController : Controller + { + [Route("api/v1/server/version")] + [HttpGet] + public ActionResult GetVersion() + { + return Assembly.GetExecutingAssembly().GetCustomAttribute().InformationalVersion; + } + } +}