خطوات رفع الموقع على استضافة heroku

1 Helmet helps you secure your Express apps by setting various HTTP headers

in app.js :

 
const helmet = require("helmet");
 
app.use(helmet()); 
2 process.env.PORT

in app.js :

 
// mongoose
const mongoose = require("mongoose");
 
mongoose
  .connect(
    "mongodb+srv://alihassan:c4a@cluster0.offav6.mongodb.net/all-data?retryWrites=true&w=majority"
  )
  .then((result) => {
    app.listen(process.env.PORT  || 5000, () => {
      console.log("Example app listening at http://localhost:5000");
    });
  })
 
  .catch((err) => {
    console.log(err);
  }); 
3 Add .gitignore file
node_modules
4 Add Procfile file
web: node app.js

5 Download and install Git

6 Download and install Heroku CLI

7 Heroku Sign up

8 heroku login

9 cd ????????????

10 npm init

11 git init

12 heroku git:remote -a ????????????

13 node -v

14 in package.json file :

"engines": {
"node": "???????"
}

15 git add .

16 git commit -am "first deploy "

17 git push heroku master

رفع الموقع بعد التعديل عليه

1 git add .

2 git commit -am "new update"

3 git push heroku master

الفيديو
تحميل الملفات
😡
انت مشغل الـ AdBlock !!

ياريت تقفله لوسمحت 😊 😊

تنبيه هام ✋

إذا كانت الإعلانات مزعجة بالنسبة لك، فيُمكنك التبرع ب50$ وسيتم إيقاف الإعلانات لمدة شهر لجميع زوار الموقع 🧡 ويُمكنك التواصل معنا عن طريق صفحة الفيس بوك