This repository has been archived on 2023-06-30. You can view files and clone it, but cannot push or open issues or pull requests.
2chBackAPI/APIControllers/ShowThreads.cs

22 lines
631 B
C#
Raw Permalink Normal View History

2022-11-24 12:56:07 +10:00
using Microsoft.AspNetCore.Mvc;
2022-11-25 22:40:17 +10:00
using NeDvachAPI.BufferControllers;
2022-11-24 12:56:07 +10:00
using System.Text.Json;
using System.Web.Http;
using HttpGetAttribute = Microsoft.AspNetCore.Mvc.HttpGetAttribute;
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;
namespace NeDvachAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class ThreadsController : ControllerBase
{
[HttpGet(Name = "GetThreads")]
public string Get([FromUri] string board)
{
2022-11-25 22:40:17 +10:00
string postsJson = JsonSerializer.Serialize(APIThreadBuffer.GetThreadPreviews());
2022-11-25 12:37:26 +10:00
return postsJson;
2022-11-24 12:56:07 +10:00
}
}
}