Smartedu Projesi Deployment


Heroku ortamına yükleme işlemine başlamadan önce öncelikle Atlas Cloud tarafında veritabanını oluşturuyoruz. İlgili kullanıcı adımızı ve şifreyi kullanarak MongoDB bağlantımızı güncelliyoruz.


App.js dosyamızda port numarasını güncelliyoruz.


const port = process.env.PORT || 5000;
app.listen(port, () => {
  console.log(`App started on port ${port}`);
});


Package. json dosyamızı nodemon ile değil node ile çalıştırmamız gerekir.


"start": "node app.js"


Heroku tarafında kullanmamız gereken komutlar:


$ heroku login


Yeni bir Git repository oluşturmak için:


$ cd my-project/
$ git init
$ heroku git:remote -a testo-testox


Deploy komutları:


$ git add .
$ git commit -am "make it better"
$ git push heroku main // Biz burada main branchı göndereceğiz.



https://smartedu-app.herokuapp.com/


Lesson discussion

Swap insights and ask questions about Node.js

Be the first to start the discussion

Ask a question or share your thoughts about this lesson.