diff --git a/frontend/Pages/Index.cshtml b/frontend/Pages/Index.cshtml index 5858671..63a4755 100644 --- a/frontend/Pages/Index.cshtml +++ b/frontend/Pages/Index.cshtml @@ -12,8 +12,12 @@ -
Environment is Development
+
Environment is Development
+ -
Environment is NOT Development
+
Environment is NOT Development
+ +
Environment: @Model.envEnvironment
+
API Url: @Model.envAPIProductionUrl
diff --git a/frontend/Pages/Index.cshtml.cs b/frontend/Pages/Index.cshtml.cs index 9ffcb48..1bdc249 100644 --- a/frontend/Pages/Index.cshtml.cs +++ b/frontend/Pages/Index.cshtml.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace frontend.Pages @@ -11,14 +12,20 @@ namespace frontend.Pages public class IndexModel : PageModel { private readonly ILogger _logger; + private readonly IConfiguration _config; + public string envEnvironment { get; set; } + public string envAPIProductionUrl { get; set; } - public IndexModel(ILogger logger) + public IndexModel(ILogger logger, IConfiguration config) { _logger = logger; + _config = config; } public void OnGet() { + envEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + envAPIProductionUrl = _config["APIProductionUrl"]; } }