From 9add92c170c074fb59d07ea95baccf04f9a88652 Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 18 Mar 2023 15:38:35 +0000 Subject: [PATCH] split api settings --- WeatherDashboard.Web/Services/WeatherApiForecastService.cs | 4 ++-- WeatherDashboard.Web/appsettings.json | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/WeatherDashboard.Web/Services/WeatherApiForecastService.cs b/WeatherDashboard.Web/Services/WeatherApiForecastService.cs index 7f2a2de..972be81 100644 --- a/WeatherDashboard.Web/Services/WeatherApiForecastService.cs +++ b/WeatherDashboard.Web/Services/WeatherApiForecastService.cs @@ -13,8 +13,8 @@ namespace WeatherDashboard.Web.Services { this.configuration = configuration; - apiBaseUrl = configuration["ApiBaseUrl"]; - apiKey = configuration["ApiKey"]; + apiBaseUrl = configuration["Api:BaseUrl"]; + apiKey = configuration["Api:Key"]; httpClient = httpClientFactory.CreateClient(); } diff --git a/WeatherDashboard.Web/appsettings.json b/WeatherDashboard.Web/appsettings.json index c6650bb..c02a7b4 100644 --- a/WeatherDashboard.Web/appsettings.json +++ b/WeatherDashboard.Web/appsettings.json @@ -6,6 +6,8 @@ } }, "AllowedHosts": "*", - "ApiBaseUrl": "https://api.weatherapi.com", - "ApiKey": "829fbbe5beb2424aa1021928230702" + "Api": { + "BaseUrl": "https://api.weatherapi.com", + "Key": "829fbbe5beb2424aa1021928230702" + } }