From fb854ac830ffbbd2dbce23972f6e58efb7de767a Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 17 Jul 2019 00:38:48 -0600 Subject: [PATCH] Show environment --- OFBButte.Api/Controllers/ValuesController.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OFBButte.Api/Controllers/ValuesController.cs b/OFBButte.Api/Controllers/ValuesController.cs index ea0705c..87d00a5 100644 --- a/OFBButte.Api/Controllers/ValuesController.cs +++ b/OFBButte.Api/Controllers/ValuesController.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using OFBButte.Application.Configuration; namespace OFBButte.Api.Controllers { @@ -10,11 +12,17 @@ namespace OFBButte.Api.Controllers [ApiController] public class ValuesController : ControllerBase { + private readonly AppSettings appSettings; + public ValuesController(IOptions options) + { + this.appSettings = options.Value; + } + // GET api/values [HttpGet] public ActionResult> Get() { - return new string[] { "value1 updated", "value2" }; + return new string[] { "value1 updated", "value2", appSettings.Environment }; } // GET api/values/5