19 lines
493 B
C#
19 lines
493 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.Text.Json;
|
|
|
|
namespace NeDvachAPI.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class PostToController : ControllerBase
|
|
{
|
|
[HttpPost(Name = "PostPosts")]
|
|
public JsonResult ReceivePost([FromBody] Post ReceivedPost)
|
|
{
|
|
Console.WriteLine("Принят пост");
|
|
DBchat.SendPost(ReceivedPost);
|
|
return new JsonResult("Posted Successfully!");
|
|
}
|
|
}
|
|
}
|