Show environment

master
dan 2019-07-17 00:38:48 -06:00
parent 47ca31be5e
commit fb854ac830
1 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using OFBButte.Application.Configuration;
namespace OFBButte.Api.Controllers namespace OFBButte.Api.Controllers
{ {
@ -10,11 +12,17 @@ namespace OFBButte.Api.Controllers
[ApiController] [ApiController]
public class ValuesController : ControllerBase public class ValuesController : ControllerBase
{ {
private readonly AppSettings appSettings;
public ValuesController(IOptions<AppSettings> options)
{
this.appSettings = options.Value;
}
// GET api/values // GET api/values
[HttpGet] [HttpGet]
public ActionResult<IEnumerable<string>> Get() public ActionResult<IEnumerable<string>> Get()
{ {
return new string[] { "value1 updated", "value2" }; return new string[] { "value1 updated", "value2", appSettings.Environment };
} }
// GET api/values/5 // GET api/values/5