aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/TodoListController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-02-18 19:56:13 +0800
committercrupest <crupest@outlook.com>2019-02-18 19:56:13 +0800
commit1ff6afb0e9fd11ce37ed0206b992514041391761 (patch)
tree328e729bbbc08bcf8a16fc494cb1c6625e35d2a6 /Timeline/Controllers/TodoListController.cs
parenta8d850e05fba39a46f54d3c2827e8b93bcbb129b (diff)
downloadtimeline-1ff6afb0e9fd11ce37ed0206b992514041391761.tar.gz
timeline-1ff6afb0e9fd11ce37ed0206b992514041391761.tar.bz2
timeline-1ff6afb0e9fd11ce37ed0206b992514041391761.zip
Add get pat api.
Diffstat (limited to 'Timeline/Controllers/TodoListController.cs')
-rw-r--r--Timeline/Controllers/TodoListController.cs30
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);
+ }
+ }
+}