From 780ca056ec58e066d0c230e27221f5502ee90092 Mon Sep 17 00:00:00 2001 From: Ryan Peters Date: Sat, 18 Mar 2023 22:27:28 -0400 Subject: [PATCH] add api controller --- .../Controllers/ApiController.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 WeatherDashboard.Web/Controllers/ApiController.cs diff --git a/WeatherDashboard.Web/Controllers/ApiController.cs b/WeatherDashboard.Web/Controllers/ApiController.cs new file mode 100644 index 0000000..fd015ec --- /dev/null +++ b/WeatherDashboard.Web/Controllers/ApiController.cs @@ -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 Get() => forecastService.GetWeatherAsync(); + } +} \ No newline at end of file