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.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<AppSettings> options)
{
this.appSettings = options.Value;
}
// GET api/values
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new string[] { "value1 updated", "value2" };
return new string[] { "value1 updated", "value2", appSettings.Environment };
}
// GET api/values/5