diff options
Diffstat (limited to 'Backend/GetStopList.cs')
| -rw-r--r-- | Backend/GetStopList.cs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/Backend/GetStopList.cs b/Backend/GetStopList.cs deleted file mode 100644 index e3a1894..0000000 --- a/Backend/GetStopList.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.Azure.Functions.Worker; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Costasdev.VigoTransitApi; - -namespace Costasdev.UrbanoVigoWeb; - -public class GetStopList -{ - private readonly VigoTransitApiClient _api; - - public GetStopList(HttpClient http) - { - _api = new VigoTransitApiClient(http); - } - - [Function("GetStopList")] - public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req) - { - try - { - var stops = await _api.GetStops(); - return new OkObjectResult(stops); - } - catch (InvalidOperationException) - { - return new BadRequestObjectResult("Failed to retrieve stops"); - } - } -} - |
