Show environment
parent
47ca31be5e
commit
fb854ac830
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue