Skip to content

Instantly share code, notes, and snippets.

@routonmh
Last active April 10, 2020 02:32
Show Gist options
  • Save routonmh/790bda571251f7df8289131a857c7e36 to your computer and use it in GitHub Desktop.
Save routonmh/790bda571251f7df8289131a857c7e36 to your computer and use it in GitHub Desktop.
Node.js vsASP .NET Core
[HttpPost("submit-comment")]
public async Task<ActionResult> SubmitComment([Required, FromBody] CommentSubmission submission)
{
if (await Model.AddCommentSubmission(submission))
return new OkResult();
return new BadRequestResult();
}
Router.post('/submit-comment', async (req, res) => {
let success = await Model.addComment(req.body);
if (success)
res.sendStatus(200);
res.sendStatus(400);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment