I read all the other posts on this topic, but I can not find the answer for my problem. I have an Express server running by default or 5000 (process.env.PORT || 5000). Then I added socket.io, but the client side cannot find the socket.io.js file. After some tests, I assume there is a problem with some port conflicts or something else. Here is my server code:
var express = require('express'),
app = express(),
bodyParser = require('body-parser'),
server = require('http').createServer(app),
io = require('socket.io').listen(server);
app.set('port', (process.env.PORT || 5000));
Edit: client side material: 
Edit 2: Also, I don't think this is important, but I am testing this on the local Heroku server.
Edit 3: Directory structure:
--api
--images
--node_modules
--scripts
--pages
main_page.ejs
--styles
composer
index.js
npm-debug
package
Edit 4: Bump
source
share