You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ All application configuration files are stored here grouped by its functionalite
42
42
`cors.js` setting the Cross-Origin Resource Sharing protection.
43
43
44
44
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.
46
46
47
47
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.
48
48
@@ -56,7 +56,7 @@ module.exports = {
56
56
}
57
57
```
58
58
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')`.
60
60
61
61
## Public directory
62
62
@@ -66,7 +66,7 @@ Here we can put our static files such as image, css, js, uploads and other clien
66
66
67
67
Contains the MVC folder structure:
68
68
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.
`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.
102
104
103
105
```javascript
104
106
# User.js
@@ -130,10 +132,6 @@ The default engine is `ejs`. You can change views settings from `app.js`
130
132
131
133
```
132
134
133
-
`Note` api routes defined in `api.js` are prefixed by default with the value of configuation `_config.app.api_prefix`;
134
-
135
-
136
-
137
135
`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.
138
136
139
137
```javascript
@@ -249,7 +247,7 @@ _url("css/style.css");
249
247
250
248
This application comes with two type of authentication methods:
251
249
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.
0 commit comments