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/Controllers/GetPosts.cs
RakVhalate 2a71885a85
Some checks failed
continuous-integration/drone/push Build is failing
some fix
2022-10-20 22:28:12 +10:00

23 lines
562 B
C#

using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
namespace NeDvachAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class ListController : ControllerBase
{
[HttpGet(Name = "GetPosts")]
public string Get()
{
//Post[] posts = DBchat.DbList();
List<Post> posts = DBchat.DbList();
string postsJson = JsonSerializer.Serialize(posts);
Console.WriteLine("Запрошен список постов.");
return postsJson ;
}
}
}