Skip to content

Commit 84d1e7f

Browse files
committed
2 parents e29e89d + e7de017 commit 84d1e7f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ All application configuration files are stored here grouped by its functionalite
4242
`cors.js` setting the Cross-Origin Resource Sharing protection.
4343

4444

45-
In production environment. we always need a different configuration parameters that what the `config/env.js` do.
45+
In production environment. we always need a different configuration parameters that what the `config/env` directory do.
4646

4747
The application gets the enviroment stored in `app.js` file and load the evironment file. So if we are working in `production` environment, the application will automatically load the configuration file `config/env/production.js` and uses its defined items to override items stored outside.
4848

@@ -56,7 +56,7 @@ module.exports = {
5656
}
5757
```
5858

59-
We can access configuration using the `_config` object. so if we want to get the environment key we call `_config('app.env')`.
59+
We can access configuration using the `_config()` function. so if we want to get the environment key we call `_config('app.env')`.
6060

6161
## Public directory
6262

@@ -66,7 +66,7 @@ Here we can put our static files such as image, css, js, uploads and other clien
6666

6767
Contains the MVC folder structure:
6868

69-
`controllers` are modules. each of them exports an object of methods that accepts request and response.
69+
`controllers` are modules. each of them exports an object of methods that accept request and response.
7070

7171
```javascript
7272
# HomeController.js
@@ -98,7 +98,9 @@ router.get("/", HomeController.index);
9898
module.exports = router;
9999
```
100100

101-
`models` define the mongoose collection models that interact directly to database.
101+
`Note` api routes defined in `api.js` are prefixed by default with the value of configuation `_config.app.api_prefix`;
102+
103+
`models` define the mongoose collection models that interact directly with database.
102104

103105
```javascript
104106
# User.js
@@ -130,10 +132,6 @@ The default engine is `ejs`. You can change views settings from `app.js`
130132

131133
```
132134

133-
`Note` api routes defined in `api.js` are prefixed by default with the value of configuation `_config.app.api_prefix`;
134-
135-
136-
137135
`middlewares` are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. The next middleware function is commonly denoted by a variable named next.
138136

139137
```javascript
@@ -249,7 +247,7 @@ _url("css/style.css");
249247

250248
This application comes with two type of authentication methods:
251249

252-
`session` for working with server side rendering applications which authentication is stored in session and browser cookie.
250+
`session` for working with server side rendering applications which authentication meta data is stored as session files on server and cookies in browser and browser sends this cookie with any request.
253251

254252
You can set the session using `login` function
255253

0 commit comments

Comments
 (0)