https://devcenter.heroku.com/articles...
-First: Have an account (heroku account);
-confirm the installation of git npm and node
-brew tap heroku/brew && brew install heroku (install heroku using your terminal)
-make sure you have a Procfile in your app project directly
web: npm app.js (Your Procfile should contain that)
-In your code, make sure the port is process.env.PORT || port (where port is my local 3000);
//Listening port;
const port = 3000;
app.listen(process.env.PORT || port, function(){
console.log('Listening on port' + port);
});
-heroku login (Login to your heroku account both browser and terminal)
-npm init, git init, add, commit
-heroku create
-git push heroku main
-heroku open
-heroku logs —tail
Watch video How to Deploy a Node JS app on heroku Properly Fix h10 errors online without registration, duration hours minute second in high quality. This video was added by user roktech 27 September 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,94 once and liked it 1 people.