How to resolve a 404 (Not Found) error?

If you’re running Express 4, it appears to me like you’re missing the lines of code:

var app = express();
var server = app.listen(3000);

That will start your web server and set it to port 3000. See the bone simple Express 4 app here:

And, then to start up, you would add:

var io = require('').listen(server);

And, there is no need for this line:

var http = require('http');

Leave a Comment