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

19 lines
431 B
C#
Raw Normal View History

2022-10-17 14:29:09 +10:00
using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
namespace NeDvachAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class HomeController : ControllerBase
{
[HttpGet(Name = "GetPosts")]
public string Get()
{
Post[] posts = DBchat.DbList();
string postsJson = JsonSerializer.Serialize(posts);
return postsJson ;
}
}
}