I've been following this(http://socket.io/get-started/chat/) tutorial on how to make a simple chat application using socket.io.
I tried to however use Express to create it and I was wondering why port 3000 is already in use? The code below will not work unless I change the port number.
/* Make the http server listen on port 3000. */
http.listen(3000, function(){
console.log('listening on *:3000');
});
Does express use the port to do other things like routing or something? Is there a simple way to find what is happening on that port?
I may also be doing something dodgy with my require things:
var express = require('express');
var app = require('express')();
var http = require('http').Server(app);
var router = express.Router();
var io = require('socket.io')(http);
Thanks.
for me helps to make use
3000 || 3333
, and it's fix the issueI ran into this problem too and I solved it by this:
Do not use
npm start
to start your web appUse
node app.js
instead