diff options
author | crupest <crupest@outlook.com> | 2019-02-18 19:56:13 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-02-18 19:56:13 +0800 |
commit | 1f0a978ad2b8e5bcd57eef37baca93e00fd6b20b (patch) | |
tree | 8e1e2ac2dd6df278f59a97a37e5d374bc2644843 /Timeline/Controllers/TodoListController.cs | |
parent | 9756acc50f5f228968cf45d9e73c8dd3b4eacc6a (diff) | |
download | timeline-1f0a978ad2b8e5bcd57eef37baca93e00fd6b20b.tar.gz timeline-1f0a978ad2b8e5bcd57eef37baca93e00fd6b20b.tar.bz2 timeline-1f0a978ad2b8e5bcd57eef37baca93e00fd6b20b.zip |
Add get pat api.
Diffstat (limited to 'Timeline/Controllers/TodoListController.cs')
-rw-r--r-- | Timeline/Controllers/TodoListController.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Timeline/Controllers/TodoListController.cs b/Timeline/Controllers/TodoListController.cs new file mode 100644 index 00000000..b773ed2e --- /dev/null +++ b/Timeline/Controllers/TodoListController.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Timeline.Configs; + +namespace Timeline.Controllers +{ + [Route("api/[controller]")] + public class TodoListController : Controller + { + private readonly IOptionsMonitor<TodoListConfig> _config; + + public TodoListController(IOptionsMonitor<TodoListConfig> config) + { + _config = config; + } + + [HttpGet("[action]")] + [AllowAnonymous] + [Produces("text/plain")] + public ActionResult<string> AzureDevOpsPat() + { + return Ok(_config.CurrentValue.AzureDevOpsPat); + } + } +} |