22 lines
631 B
C#
22 lines
631 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using NeDvachAPI.BufferControllers;
|
|
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)
|
|
{
|
|
string postsJson = JsonSerializer.Serialize(APIThreadBuffer.GetThreadPreviews());
|
|
return postsJson;
|
|
}
|
|
}
|
|
}
|