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
For example:
var port = 8080
app.listen(port);
console.log(`Listening on port ${port}`);
Line by Line Explaination:
var port = 8080;
=>Creates a variable(everything in javascript is an object) and sets the port location to localhost 8080 app.listen(port);
=>The application made using express module checks for any connections available and if yes then it connects and the application launches
console.log('Listening on port ' + port);
=>Displays the message onto the terminal once deployed successfully