This file contains hidden or 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": |
This file contains hidden or 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 res = await fetch("http://localhost:5007/auth", { method: "POST" }); | |
const { connectionToken } = await res.json(); | |
const url = `wss://ws.quicksocket.io?t=${connectionToken}`; | |
const webSocket = new WebSocket(url); |
This file contains hidden or 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 express = require('express'); | |
const axios = require("axios"); | |
const app = express(); | |
app.post("/auth", async (req, res) => { | |
const authResponse = await axios({ | |
method: "POST", | |
url: "https://manage.quicksocket.io/auth", | |
auth: { |