using Microsoft.AspNetCore.Mvc;
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 ListController : ControllerBase
[HttpGet(Name = "GetPosts")]
public string Get([FromUri] string board = null)
//Post[] posts = DBchat.DbList();
List<Post> posts = DBchat.DbList(board);
string postsJson = JsonSerializer.Serialize(posts);
Console.WriteLine("Запрошен список постов из борды " + board);
return postsJson ;
}