Skip to content

Instantly share code, notes, and snippets.

View lukejoshuapark's full-sized avatar

Luke Joshua Park lukejoshuapark

View GitHub Profile
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":
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);
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: {