new-infofer-scraper/server/Controllers/V2/StationsController.cs

23 lines
534 B
C#
Raw Normal View History

using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
2022-11-09 05:17:39 +01:00
using Server.Models.Database;
using Server.Services.Interfaces;
namespace Server.Controllers.V2;
[ApiController]
[ApiExplorerSettings(GroupName = "v2")]
[Route("/v2/[controller]")]
public class StationsController : Controller {
private IDatabase Database { get; }
public StationsController(IDatabase database) {
this.Database = database;
}
[HttpGet("")]
2022-11-09 05:17:39 +01:00
public ActionResult<IEnumerable<StationListing>> ListStations() {
return Ok(Database.Stations);
}
}