Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
express js bangla tutorial 12 : How to set up environment variables
Play lesson

Node, Express, MongoDB, Authentication - express js bangla tutorial 12 : How to set up environment variables

5.0 (0)
7 learners

What you'll learn

This course includes

  • 19 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Learning Outcome: 1) How to set up an environment variable? Step 1: create an .env file in the root directory Step 2: define environment variable(S) using uppercase letters and underscore if more than one word. Example - PORT DATABASE_URL Step 3: Assign the values without double quotation and space PORT=3000 DATABASE_URL=mongodb+srv://medo:[email protected]/test?retryWrites=true&w=majority Step 4: you can make a comment using # # server port PORT=3000 Step 5: install dotenv package - npm install dotenv Step 6: require dotenv - require('dotenv').config(); Step 7: Access the env variables from anywhere using process.env.VARIABLE_NAME. Example – process.env.PORT; Optional: DotENV Extension - nice syntax highlighting in your .env files. node.js github link - https://github.com/anisul-Islam/NodeBasic command link video tutorial - https://youtu.be/kbyNSrhxuuI Node.js video series: https://www.youtube.com/playlist? list=PLgH5QX0i9K3r6ZGeyFnSv_YDxVON2P85m JavaScript Video series: https://www.youtube.com/playlist?list=PLgH5QX0i9K3qzryglMjcyEktz4q7ySunX bootstrap video series: https://www.youtube.com/playlist?list=PLgH5QX0i9K3oC_wmWEZa2xWxJauIRQ9kG HTML5 Course : https://www.youtube.com/playlist?list=PLgH5QX0i9K3oHBr5dsumGwjUxByN5Lnw3 CSS3 Course : https://www.youtube.com/playlist?list=PLgH5QX0i9K3qjCBXjTmv7Xeh8MDUUVJDO Subscribe : https://www.youtube.com/channel/UCEXwc6mNh7Lakj6lX-7a2Mg website : https://www.studywithanis.com Facebook : https://www.facebook.com/anisul2010s Facebook page : https://www.facebook.com/studywithanis/

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere