Created
June 25, 2020 10:51
-
-
Save velotiotech/f09f14363bacd51446d5318e5050d628 to your computer and use it in GitHub Desktop.
add auth endpoint
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
var express = require('express'); | |
var bodyParser = require('body-parser'); | |
var app = express(); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: false })); | |
app.post('/pusher/auth', function(req, res) { | |
var socketId = req.body.socket_id; | |
var channel = req.body.channel_name; | |
var auth = pusher.authenticate(socketId, channel); | |
res.send(auth); | |
}); | |
var port = process.env.PORT || 5000; | |
app.listen(port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment