I think the problem appears because Primus intercepts all requests starting with /primus
, so Express cannot serve primus.js
file.
I also suppose that in your HTML file you have something like:
<script src="/primus.js"></script>
Try to replace it with:
<script src="/public/primus.js"></script>
And then replace this line:
app.use(express.static(__dirname + '/public'));
with this one:
app.use('/public', express.static(__dirname + '/public'));
Update
Since we changed static files URI, we have to serve index.html
manually:
app.get('/', function(req, res) {
res.sendfile(__dirname + '/public/index.html');
});