Skip to content

Commit c502360

Browse files
committed
content relocation
1 parent db73986 commit c502360

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

session 5/chapters/1. Hello Nodejs World.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,3 @@ server.listen(port, () => {
4848
console.log(`Server running on http://localhost:${port}/`);
4949
});
5050
```
51-
52-
# Purpose of Environment Variables
53-
54-
[ref](https://www.section.io/engineering-education/nodejs-environment-variables/)
55-
56-
Environment Variables are important to a software developer for multiple reasons.
57-
58-
1. Separation of Concerns
59-
60-
Separation of Concerns refers to a software design principle that states that computer programs should be divided into distinct sections, such that each section addresses a separate concern.
61-
62-
Application Configuration is a section of the code that should be decoupled from the application. Good software practices state that app config requires strict separation of config from code. Such config files can be stored as environment variables.
63-
64-
2. Protecting Config Keys
65-
66-
With the increasing popularity of cloud computing, more applications are using cloud services and other external APIs. Most of these come with config keys for control and access management. If the API keys are added to the application, and the code is pushed to a public repository on GitHub, this could lead to an unmonitored access problem. Unknown parties might end up using your API keys, leading to an unintended bill for your cloud services, and other potential security issues.
67-
68-
To solve this problem, the config keys can be added as environment variables and invoked from a closed environment from where the application is deployed.

session 5/chapters/3. Environment Variables in Nodejs.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Environment Variables in Node.js
22

3-
In Node.js, process.env is a global variable that is injected during runtime. It is a view of the state of the system environment variables. When we set an environment variable, it is loaded into process.env during runtime and can later be accessed.
3+
In Node.js, `process.env` is a global variable that is injected during runtime. It is a view of the state of the system environment variables. When we set an environment variable, it is loaded into `process.env` during runtime and can later be accessed.
44

5-
dotenv is a module available on npm to load environment variables into process.env. dotenv can be added to your Node.js project by installing it from npm or yarn:
5+
`dotenv` is a module available on npm to load environment variables into process.env. dotenv can be added to your Node.js project by installing it from npm or yarn:
66

77
```
88
# with npm
@@ -34,3 +34,21 @@ DB_PASS=password
3434
```
3535

3636
We can add this .env file to .gitignore so that our credentials are protected.
37+
38+
# Purpose of Environment Variables
39+
40+
[ref](https://www.section.io/engineering-education/nodejs-environment-variables/)
41+
42+
Environment Variables are important to a software developer for multiple reasons.
43+
44+
1. Separation of Concerns
45+
46+
Separation of Concerns refers to a software design principle that states that computer programs should be divided into distinct sections, such that each section addresses a separate concern.
47+
48+
Application Configuration is a section of the code that should be decoupled from the application. Good software practices state that app config requires strict separation of config from code. Such config files can be stored as environment variables.
49+
50+
2. Protecting Config Keys
51+
52+
With the increasing popularity of cloud computing, more applications are using cloud services and other external APIs. Most of these come with config keys for control and access management. If the API keys are added to the application, and the code is pushed to a public repository on GitHub, this could lead to an unmonitored access problem. Unknown parties might end up using your API keys, leading to an unintended bill for your cloud services, and other potential security issues.
53+
54+
To solve this problem, the config keys can be added as environment variables and invoked from a closed environment from where the application is deployed.

0 commit comments

Comments
 (0)