Created
August 15, 2022 02:38
-
-
Save lukejoshuapark/9d6f462bdc4c46ed016503e7ea112a85 to your computer and use it in GitHub Desktop.
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
app.post("/callback", async (req, res) => { | |
res.status(204); | |
res.send(); | |
// Remember to include security checks here - see the documentation | |
// for more information. | |
const { action, referenceId, payload } = req.body; | |
switch (action) { | |
case "CONNECT": | |
console.log("User", referenceId, "connected!"); | |
break; | |
case "DISCONNECT": | |
console.log("User", referenceId, "disconnected!"); | |
break; | |
case "MESSAGE": | |
console.log("User", referenceId, "sent", payload); | |
break; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment