1. In app.js:
Import Express framework
Listen to the right port.
app.listen(process.env.PORT || 8080, () => {
// process.env.PORT is for Heroku's port
if (process.env.PORT) {
console.log('port: ' + process.env.PORT);
} else {
console.log('port: 8080')
}
})
2. Create a file called Procfile
inside: web: npm start