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/PostPost.cs
RakVhalate 6da7a84cab
All checks were successful
continuous-integration/drone/push Build is passing
added Ip logging
2022-11-22 18:03:38 +10:00

20 lines
568 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)
{
string ipAddress = Request.HttpContext.Connection.RemoteIpAddress.ToString();
ReceivedPost.Ip = ipAddress;
DBchat.SendPost(ReceivedPost);
return new JsonResult("Posted Successfully!");
}
}
}