Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created February 11, 2022 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/bd5dd9cf5c83e2a6336e524c27d20993 to your computer and use it in GitHub Desktop.
Save sendbird-community/bd5dd9cf5c83e2a6336e524c27d20993 to your computer and use it in GitHub Desktop.
Post method
const app = express();
const port = 3000;
app.post("/analyze_message", async (req, res) => {
const body = req.body;
const parsedBody = JSON.parse(body);
var channelUrl = parsedBody.channel.channel_url;
var message = parsedBody.payload.message;
var senderId = parsedBody.sender.user_id;
testToxicity(message, channelUrl, senderId);
res.send(parsedBody);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment