Skip to content

Commit

Permalink
change api test to /api/ path
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcrane committed Nov 27, 2023
1 parent d75d80f commit 3316134
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LeedsExperiment/Dashboard/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public IActionResult Index()

public async Task<IActionResult> ForecastAsync()
{
var forecasts = await preservation.GetWeatherForecasts();
var forecasts = await preservation.Test();
return View(forecasts[0]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Preservation.API.Controllers
{
[ApiController]
[Route("[controller]")]
[Route("api/test")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
Expand Down
2 changes: 1 addition & 1 deletion LeedsExperiment/Preservation.API/PreservationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public PreservationService(HttpClient httpClient)
_httpClient = httpClient;
}

public async Task<WeatherForecast[]> GetWeatherForecasts()
public async Task<WeatherForecast[]> Test()
{
var response = await _httpClient.GetAsync("/WeatherForecast");
var forecasts = await response.Content.ReadFromJsonAsync<WeatherForecast[]>();
Expand Down
2 changes: 1 addition & 1 deletion LeedsExperiment/Preservation/IPreservation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public interface IPreservation
{
Task<WeatherForecast[]> GetWeatherForecasts();
Task<WeatherForecast[]> Test();
}
}
4 changes: 2 additions & 2 deletions LeedsExperiment/Preservation/PreservationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public PreservationService(HttpClient httpClient)
_httpClient = httpClient;
}

public async Task<WeatherForecast[]> GetWeatherForecasts()
public async Task<WeatherForecast[]> Test()
{
var response = await _httpClient.GetAsync("/WeatherForecast");
var response = await _httpClient.GetAsync("/api/test");
var forecasts = await response.Content.ReadFromJsonAsync<WeatherForecast[]>();
if(forecasts != null)
{
Expand Down

0 comments on commit 3316134

Please sign in to comment.