Skip to content

Commit dba020e

Browse files
author
David Wright
committed
Settings Controller Setup
1 parent 9a9140c commit dba020e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Controllers/SettingsController.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using Staticat.ChurchMS.WebClient.Models;
7+
8+
namespace Staticat.ChurchMS.WebClient.Controllers
9+
{
10+
[Route("[Controller]")]
11+
public class SettingsController : Controller
12+
{
13+
[HttpGet]
14+
[ProducesResponseType(typeof(Settings), 200)]
15+
public IActionResult GetSettings()
16+
{
17+
var settings = new Settings
18+
{
19+
Environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
20+
};
21+
22+
return Ok(settings);
23+
}
24+
}
25+
}

Models/Settings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Staticat.ChurchMS.WebClient.Models
2+
{
3+
public class Settings
4+
{
5+
public string Environment { get; set; }
6+
}
7+
}

0 commit comments

Comments
 (0)