Created
February 11, 2022 17:04
-
-
Save sendbird-community/bd5dd9cf5c83e2a6336e524c27d20993 to your computer and use it in GitHub Desktop.
Post method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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