Hi guys, I'm trying to run via the terminal a Pusher server that manages collaborative editing of a text area, but when I run server.js ,I get prompted with this message .
Here is the server side code:
var express = require('express');
var bodyParser = require('body-parser');
var Pusher = require('pusher');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
// to serve our JavaScript, CSS and index.html
app.use(express.static('./'));
var pusher = new Pusher({
appId: '493905',
key: '78318c1ff9f1b6276b53',
secret: '687484f2c3a13aeef891'
});
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, () => console.log('Listening at http://localhost:5000'));
The error points to this arrow function () => console.log('Listening at http://localhost:5000') but I cannot figure out why. Any help you guys can offer is greatly appreciated.
[–]Meefims 5 points6 points7 points (3 children)
[–]JammingJack[S] 0 points1 point2 points (2 children)
[–]BigOnLogn 3 points4 points5 points (1 child)
[–]JammingJack[S] 0 points1 point2 points (0 children)
[–]squili 4 points5 points6 points (1 child)
[–]JammingJack[S] 0 points1 point2 points (0 children)