add api controller

This commit is contained in:
Ryan Peters 2023-03-18 22:27:28 -04:00
parent 1238358272
commit 780ca056ec

View File

@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Mvc;
using WeatherDashboard.Web.Services;
namespace WeatherDashboard.Web.Controllers
{
[ApiController]
[Route("api")]
public class ApiController : Controller
{
private readonly IForecastService forecastService;
public ApiController(IForecastService forecastService) => this.forecastService = forecastService;
public Task<WeatherSet> Get() => forecastService.GetWeatherAsync();
}
}