I\'ve been trying to use Express.js to launch a website. At first, I was using
app.set(\'port\', 8080)
but the browser was unable to connect to the page. Afterwards
It is simple enough to declare a variable server at the bottom of the page and define the port that you want. You can console.log the port so that it will be visible in the command line.
var server = app.listen(8080,function(){
console.log('express server listening on port ' + server.address().port);
})