express-sweet 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +76 -9
  2. package/LICENSE +1 -1
  3. package/README.md +2193 -20
  4. package/configuration_sample/cjs/authentication.js +103 -0
  5. package/configuration_sample/cjs/config.js +74 -0
  6. package/configuration_sample/cjs/database.js +35 -0
  7. package/configuration_sample/cjs/view.js +36 -0
  8. package/configuration_sample/esm/authentication.js +103 -0
  9. package/configuration_sample/esm/config.js +74 -0
  10. package/configuration_sample/esm/database.js +35 -0
  11. package/configuration_sample/esm/view.js +36 -0
  12. package/dist/build.cjs +22 -22
  13. package/dist/build.mjs +22 -22
  14. package/package.json +8 -11
  15. package/screencaps/belongs-to-many.png +0 -0
  16. package/screencaps/belongs-to.png +0 -0
  17. package/screencaps/demonstration.webp +0 -0
  18. package/screencaps/has-many.png +0 -0
  19. package/screencaps/has-one.png +0 -0
  20. package/types/database/Database.d.ts +3 -171
  21. package/types/database/Model.d.ts +22 -19
  22. package/types/database/loadModels.d.ts +2 -1
  23. package/types/handlebars_helpers/array.d.ts +20 -0
  24. package/types/handlebars_helpers/comparison.d.ts +59 -189
  25. package/types/handlebars_helpers/date.d.ts +4 -4
  26. package/types/handlebars_helpers/html.d.ts +3 -3
  27. package/types/handlebars_helpers/index.d.ts +2 -0
  28. package/types/handlebars_helpers/layouts.d.ts +21 -0
  29. package/types/handlebars_helpers/math.d.ts +14 -21
  30. package/types/handlebars_helpers/number.d.ts +5 -5
  31. package/types/handlebars_helpers/object.d.ts +4 -4
  32. package/types/handlebars_helpers/string.d.ts +8 -13
  33. package/types/interfaces/AuthenticationConfig.d.ts +4 -11
  34. package/types/interfaces/BasicConfig.d.ts +11 -15
  35. package/types/interfaces/ViewConfig.d.ts +1 -3
  36. package/types/middlewares/Authentication.d.ts +3 -1
  37. package/types/middlewares/CORS.d.ts +3 -1
  38. package/types/middlewares/Environment.d.ts +3 -3
  39. package/types/middlewares/ErrorHandler.d.ts +3 -1
  40. package/types/middlewares/Http.d.ts +3 -1
  41. package/types/middlewares/Local.d.ts +3 -1
  42. package/types/middlewares/View.d.ts +6 -2
  43. package/types/mount.d.ts +3 -2
  44. package/types/routing/Router.d.ts +3 -1
  45. package/types/services/Authentication.d.ts +4 -2
  46. package/types/utils/Types.d.ts +2 -2
  47. package/types/utils/isAsyncFunction.d.ts +7 -7
  48. package/types/utils/isFunction.d.ts +8 -8
  49. package/types/utils/loadAuthenticationConfig.d.ts +2 -2
  50. package/types/utils/loadBasicConfig.d.ts +2 -2
  51. package/types/utils/loadDatabaseConfig.d.ts +2 -2
  52. package/types/utils/loadViewConfig.d.ts +2 -2
  53. package/INSTALL-Redis.md +0 -77
  54. package/QUICK_START.md +0 -149
  55. package/screencaps/login.jpg +0 -0
  56. package/screencaps/personal.jpg +0 -0
  57. package/screencaps/user-editing.jpg +0 -0
  58. package/screencaps/users.jpg +0 -0
@@ -1,6 +1,6 @@
1
1
  import express from 'express';
2
2
  /**
3
- * Express Sweet basic configuration interface.
3
+ * EXPRESS SWEET basic configuration interface.
4
4
  */
5
5
  export default interface BasicConfig {
6
6
  /**
@@ -32,20 +32,17 @@ export default interface BasicConfig {
32
32
  * This is a hook that rewrites the base URL.
33
33
  * If you want to rewrite the app.locals.baseUrl property and the view's baseUrl variable, use this hook to return a new base URL.
34
34
  * The default value is the referrer's origin (eg https://example.com).
35
- *
35
+ * @type {(baseUrl: string): string}
36
36
  * @example
37
37
  * rewrite_base_url: baseUrl => {
38
38
  * return `${baseUrl}/admin`;
39
39
  * }
40
- *
41
- * @type {(baseUrl: string): string}
42
40
  */
43
41
  rewrite_base_url?: (baseUrl: string) => string;
44
42
  /**
45
43
  * How to determine if it is an ajax request.
46
44
  * The default is that if there is an XMLHttpRequest in the request header (req.xhr) returns true.
47
45
  * For example, if there is no XMLHttpRequest in req(express.Request) and the Ajax endpoint starts with /api, a custom Ajax decision can be made like "return /^\/api\//.test(req.path)".
48
- *
49
46
  * @type {(req: express.Request) => boolean}
50
47
  * @example
51
48
  * is_ajax: req => {
@@ -57,18 +54,17 @@ export default interface BasicConfig {
57
54
  is_ajax: (req: express.Request) => boolean;
58
55
  /**
59
56
  * Hooks the default behavior on request errors.
60
- * If unset, simply returns an error HTTP status. (<code>res.status(err.status||500).end();</code>)
61
- *
62
- * @type {(err: any, req: express.Request, res: express.Response, next: express.NextFunction) => void}
57
+ * If unset, simply returns an error HTTP status. (<code>res.status(error.status||500).end();</code>)
58
+ * @type {(error: any, req: express.Request, res: express.Response, next: express.NextFunction) => void}
63
59
  * @example
64
- * hook_handle_error: (err, req, res, next) => {
65
- * if (err.status === 404)
66
- * // If the URL cannot be found, a 404 error screen (views/error-404.hbs) is displayed.
67
- * res.render('error-404');
60
+ * hook_handle_error: (error, req, res, next) => {
61
+ * if (error.status === 404)
62
+ * // If the URL cannot be found, a 404 error screen (views/errors/404.hbs) is displayed.
63
+ * res.render('errors/404');
68
64
  * else
69
- * // For other errors, unknown error screen (views/error-unknown.hbs) is displayed.
70
- * res.render('error-unknown');
65
+ * // For other errors, unknown error screen (views/error/500.hbs) is displayed.
66
+ * res.render('error/500');
71
67
  * },
72
68
  */
73
- hook_handle_error?: (err: any, req: express.Request, res: express.Response, next: express.NextFunction) => void;
69
+ hook_handle_error?: (error: any, req: express.Request, res: express.Response, next: express.NextFunction) => void;
74
70
  }
@@ -31,14 +31,12 @@ export default interface SesOptions {
31
31
  /**
32
32
  * Hook function just before the view is rendered.
33
33
  * For example, you can set your own local variables that can be used within the view.
34
- *
34
+ * @type {(res: express.Response) => Promise<void>|void}
35
35
  * @example
36
36
  * // The message set here can be referenced in the view as {{message}}.
37
37
  * beforeRender: (req, res) => {
38
38
  * res.locals.extra = 'Extra';
39
39
  * }
40
- *
41
- * @type {(res: express.Response) => Promise<void>|void}
42
40
  */
43
41
  beforeRender?: (req: express.Request, res: express.Response) => Promise<void> | void;
44
42
  }
@@ -8,6 +8,8 @@ export default class {
8
8
  #private;
9
9
  /**
10
10
  * Mount on application.
11
+ * @param {express.Express} app Express application instance.
12
+ * @return {Promise<void>}
11
13
  */
12
- static mount(app: express.Express): undefined;
14
+ static mount(app: express.Express): Promise<void>;
13
15
  }
@@ -5,6 +5,8 @@ import express from 'express';
5
5
  export default class {
6
6
  /**
7
7
  * Mount on application.
8
+ * @param {express.Express} app Express application instance.
9
+ * @return {Promise<void>}
8
10
  */
9
- static mount(app: express.Express): void;
11
+ static mount(app: express.Express): Promise<void>;
10
12
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Set environment variables.
3
- * Read the environment variable file in options.path and set it in "process.env".
2
+ * Mount environment variables. Read the environment variable file in options.path and set it in "process.env".
4
3
  */
5
4
  export default class {
6
5
  /**
7
6
  * Mount on application.
7
+ * @return {Promise<void>}
8
8
  */
9
- static mount(): void;
9
+ static mount(): Promise<void>;
10
10
  }
@@ -5,6 +5,8 @@ import express from 'express';
5
5
  export default class {
6
6
  /**
7
7
  * Mount on application.
8
+ * @param {express.Express} app Express application instance.
9
+ * @return {Promise<void>}
8
10
  */
9
- static mount(app: express.Express): void;
11
+ static mount(app: express.Express): Promise<void>;
10
12
  }
@@ -5,6 +5,8 @@ import express from 'express';
5
5
  export default class {
6
6
  /**
7
7
  * Mount on application.
8
+ * @param {express.Express} app Express application instance.
9
+ * @return {Promise<void>}
8
10
  */
9
- static mount(app: express.Express): void;
11
+ static mount(app: express.Express): Promise<void>;
10
12
  }
@@ -8,6 +8,8 @@ import express from 'express';
8
8
  export default class {
9
9
  /**
10
10
  * Mount on application.
11
+ * @param {express.Express} app Express application instance.
12
+ * @return {Promise<void>}
11
13
  */
12
- static mount(app: express.Express): void;
14
+ static mount(app: express.Express): Promise<void>;
13
15
  }
@@ -5,10 +5,14 @@ import express from 'express';
5
5
  export default class {
6
6
  /**
7
7
  * Mount on application.
8
+ * @param {express.Express} app Express application instance.
9
+ * @return {Promise<void>}
8
10
  */
9
- static mount(app: express.Express): void;
11
+ static mount(app: express.Express): Promise<void>;
10
12
  /**
11
13
  * Mount middleware to be executed just before drawing the view.
14
+ * @param {express.Express} app Express application instance.
15
+ * @return {Promise<void>}
12
16
  */
13
- static mountBeforeRender(app: express.Express): void;
17
+ static mountBeforeRender(app: express.Express): Promise<void>;
14
18
  }
package/types/mount.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import express from 'express';
2
2
  /**
3
3
  * Mount extensions on your application.
4
- * @param {express.Express} app Express application instance
4
+ * @param {express.Express} app Express application instance.
5
+ * @return {Promise<void>}
5
6
  */
6
- declare const _default: (app: express.Express) => void;
7
+ declare const _default: (app: express.Express) => Promise<void>;
7
8
  export default _default;
@@ -7,6 +7,8 @@ import express from 'express';
7
7
  export default class {
8
8
  /**
9
9
  * Mount on application.
10
+ * @param {express.Express} app Express application instance.
11
+ * @return {Promise<void>}
10
12
  */
11
- static mount(app: express.Express): void;
13
+ static mount(app: express.Express): Promise<void>;
12
14
  }
@@ -19,12 +19,14 @@ export default class {
19
19
  /**
20
20
  * Redirects to the page that responds immediately after successful authentication set in "success_redirect" of "config/authentication.js".
21
21
  * @param {express.Response} res The res object represents the HTTP response that an Express app sends when it gets an HTTP request.
22
+ * @return {Promise<void>}
22
23
  */
23
- static successRedirect(res: express.Response): void;
24
+ static successRedirect(res: express.Response): Promise<void>;
24
25
  /**
25
26
  * Redirects to the page that responds immediately after authentication failure set in "failure_redirect" of "config/authentication.js".
26
27
  * @param {express.Request} req The req object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on.
27
28
  * @param {express.Response} res The res object represents the HTTP response that an Express app sends when it gets an HTTP request.
29
+ * @return {Promise<void>}
28
30
  */
29
- static failureRedirect(req: express.Request, res: express.Response): void;
31
+ static failureRedirect(req: express.Request, res: express.Response): Promise<void>;
30
32
  }
@@ -4,11 +4,11 @@
4
4
  export default class {
5
5
  /**
6
6
  * Returns true for asynchronous functions, false otherwise.
7
+ * @param {Function} value.
8
+ * @return {boolean}
7
9
  * @example
8
10
  * Types.isAsyncFunction(async () => {});// true
9
11
  * Types.isAsyncFunction(() => {});// false
10
- * @param {Function} value.
11
- * @return {boolean}
12
12
  */
13
13
  static isAsyncFunction(value: Function): boolean;
14
14
  /**
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Returns true for asynchronous functions, false otherwise.
3
- * @example
4
- * utils.isAsyncFunction(async () => {});// true
5
- * utils.isAsyncFunction(() => {});// false
6
- * @param {any} value.
7
- * @return {boolean}
8
- */
2
+ * Returns true for asynchronous functions, false otherwise.
3
+ * @param {any} value.
4
+ * @return {boolean}
5
+ * @example
6
+ * utils.isAsyncFunction(async () => {});// true
7
+ * utils.isAsyncFunction(() => {});// false
8
+ */
9
9
  declare const _default: (value: any) => boolean;
10
10
  export default _default;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Returns true for functions, false otherwise.
3
- * @example
4
- * utils.isFunction(() => {});// true
5
- * utils.isFunction(async () => {});// true
6
- * utils.isFunction('');// false
7
- * @param {any} value.
8
- * @return {boolean}
9
- */
2
+ * Returns true for functions, false otherwise.
3
+ * @param {any} value.
4
+ * @return {boolean}
5
+ * @example
6
+ * utils.isFunction(() => {});// true
7
+ * utils.isFunction(async () => {});// true
8
+ * utils.isFunction('');// false
9
+ */
10
10
  declare const _default: (value: any) => boolean;
11
11
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import AuthenticationConfig from '~/interfaces/AuthenticationConfig';
2
2
  /**
3
3
  * Get Authentication configuration (config/authentication).
4
- * @return {AuthenticationConfig} Loaded configuration.
4
+ * @return {Promise<AuthenticationConfig>} Loaded configuration.
5
5
  */
6
- declare const _default: () => AuthenticationConfig;
6
+ declare const _default: () => Promise<AuthenticationConfig>;
7
7
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import BasicConfig from '~/interfaces/BasicConfig';
2
2
  /**
3
3
  * Get basic configuration (config/config).
4
- * @return {BasicConfig} Loaded configuration.
4
+ * @return {Promise<BasicConfig>} Loaded configuration.
5
5
  */
6
- declare const _default: () => BasicConfig;
6
+ declare const _default: () => Promise<BasicConfig>;
7
7
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import sequelize from 'sequelize';
2
2
  /**
3
3
  * Get database configuration (config/database).
4
- * @return {sequelize.Options} Loaded configuration.
4
+ * @return {Promise<sequelize.Options>} Loaded configuration.
5
5
  */
6
- declare const _default: () => sequelize.Options;
6
+ declare const _default: () => Promise<sequelize.Options>;
7
7
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import ViewConfig from '~/interfaces/ViewConfig';
2
2
  /**
3
3
  * Get view configuration (config/view).
4
- * @return {ViewConfig} Loaded configuration.
4
+ * @return {Promise<ViewConfig>} Loaded configuration.
5
5
  */
6
- declare const _default: () => ViewConfig;
6
+ declare const _default: () => Promise<ViewConfig>;
7
7
  export default _default;
package/INSTALL-Redis.md DELETED
@@ -1,77 +0,0 @@
1
- # Install Redis
2
- ==============
3
-
4
- ## Environment for this procedure
5
- * OS: `Amazon Linux 2`
6
- * Redis: `v6.2.6 or later`
7
- * see more: https://redis.io/download#installation
8
-
9
-
10
- ## Install Redis
11
- 1. Check the version of Redis that can be installed.
12
- ```sh
13
- amazon-linux-extras list|grep redis
14
- # Below is an example of the output.
15
- # 56 redis6 available [ =stable ]
16
- ```
17
-
18
- 1. Install Redis by specifying the version.
19
- ```sh
20
- sudo amazon-linux-extras install -y redis6
21
- ```
22
- 1. Configure and start Redis autostart.
23
- ```sh
24
- sudo systemctl status redis.service
25
- sudo systemctl start redis.service
26
- sudo systemctl enable redis.service
27
- sudo systemctl is-enabled redis.service
28
- ```
29
- 1. Check Redis process.
30
- ```sh
31
- ps -ef | grep redis | grep -v grep
32
- # Below is an example of the output.
33
- # redis 5407 1 0 11:02 ? 00:00:00 /usr/bin/redis-server 127.0.0.1:6379
34
- ```
35
- 1. Check Redis behavior. If "redis-cli ping" returns PONG, it is success.
36
- ```sh
37
- redis-cli ping
38
- # Below is an example of the output.
39
- # PONG
40
- ```
41
- 1. Test Redis read/write.
42
- ```sh
43
- redis-cli
44
-
45
- set myMessage "hello world"
46
- # OK
47
-
48
- get myMessage
49
- # "hello world"
50
- ```
51
-
52
- ## Commonly used Redis commands
53
- - Start Redis CLI
54
- ```sh
55
- redis-cli
56
- ```
57
- - Key List
58
- ```sh
59
- redis-cli --raw keys \*
60
- ```
61
-
62
- or
63
- ```sh
64
- redis-cli --scan
65
- ```
66
- - Value List
67
- ```sh
68
- redis-cli --raw mget $(redis-cli --scan)
69
- ```
70
- - Key and Value List
71
- ```sh
72
- for i in $(redis-cli keys \*); do echo $i: $(redis-cli GET $i); done
73
- ```
74
- - Delete key
75
- ```sh
76
- redis-cli del myMessage
77
- ```
package/QUICK_START.md DELETED
@@ -1,149 +0,0 @@
1
- # Quick Start
2
-
3
- The easiest way to get started with Express Sweet is to install express-sweet-generator and automatically create a template application.
4
- The following application can be started immediately by executing the template.
5
- See <a href="https://takuya-motoshima.github.io/express-sweet/v2/" target="_blank">here</a> for instructions on using express-sweet.
6
-
7
- <p align="center">
8
- <img alt="login" src="screencaps/login.jpg" width="45%">
9
- <img alt="users" src="screencaps/users.jpg" width="45%">
10
- </p>
11
- <p align="center">
12
- <img alt="user-editing" src="screencaps/user-editing.jpg" width="45%">
13
- <img alt="personal" src="screencaps/personal.jpg" width="45%">
14
- </p>
15
-
16
- 1. Use the application generator tool, express-sweet-generator, to quickly create an application skeleton.
17
- ```sh
18
- npm install -g express-sweet-generator
19
- ```
20
-
21
- 1. Create an Express myapp named myapp.
22
- The app is created in a folder named myapp in the working directory.
23
- ```sh
24
- express-sweet myapp
25
- # If you want to use ESM, below.
26
- #express-sweet -o esm myapp
27
- ```
28
- 1. Install dependent packages.
29
- ```sh
30
- cd myapp
31
- npm install
32
- ```
33
- 1. This sample application uses a database.
34
- Execute the following SQL to create the database.
35
- ```sql
36
- CREATE DATABASE IF NOT EXISTS `express_sweet_db` DEFAULT CHARACTER SET utf8mb4;
37
-
38
- USE `express_sweet_db`;
39
-
40
- CREATE TABLE `user` (
41
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
42
- `name` varchar(30) NOT NULL,
43
- `email` varchar(255) NOT NULL,
44
- `password` varchar(100) NOT NULL,
45
- `icon` varchar(768) NOT NULL DEFAULT MD5(RAND()),
46
- `created` datetime NOT NULL DEFAULT current_timestamp(),
47
- `modified` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
48
- PRIMARY KEY (`id`),
49
- UNIQUE KEY `ukUserEmail` (`email`),
50
- UNIQUE KEY `ukUserIcon`(`icon`)
51
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
52
-
53
- CREATE TABLE `profile` (
54
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
55
- `userId` int(10) unsigned NOT NULL,
56
- `address` varchar(255) NOT NULL,
57
- `tel` varchar(14) NOT NULL,
58
- `created` datetime NOT NULL DEFAULT current_timestamp(),
59
- `modified` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
60
- PRIMARY KEY (`id`),
61
- UNIQUE KEY `ukProfileUserId` (`userId`),
62
- CONSTRAINT `fkProfileUser` FOREIGN KEY (`userId`) REFERENCES `user` (`id`)
63
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
64
-
65
- CREATE TABLE `comment` (
66
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
67
- `userId` int(10) unsigned NOT NULL,
68
- `text` text NOT NULL,
69
- `created` datetime NOT NULL DEFAULT current_timestamp(),
70
- `modified` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
71
- PRIMARY KEY (`id`),
72
- CONSTRAINT `fkCommentUser` FOREIGN KEY (`userId`) REFERENCES `user` (`id`)
73
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
74
-
75
- CREATE TABLE `book` (
76
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
77
- `userId` int(10) unsigned NOT NULL,
78
- `title` text NOT NULL,
79
- `created` datetime NOT NULL DEFAULT current_timestamp(),
80
- `modified` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
81
- PRIMARY KEY (`id`),
82
- UNIQUE KEY `ukBookTitle` (`userId`, `title`(255)),
83
- CONSTRAINT `fkBookUser` FOREIGN KEY (`userId`) REFERENCES `user` (`id`)
84
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
85
-
86
- INSERT INTO `user` (`id`, `email`, `password`, `name`, `icon`) VALUES
87
- (1, 'robin@example.com', 'password', 'Robin', '/upload/1.png'),
88
- (2, 'taylor@example.com', 'password', 'Taylor', '/upload/2.png');
89
-
90
- INSERT INTO `profile` (`userId`, `address`, `tel`) VALUES
91
- (1, '777 Brockton Avenue, Abington MA 2351', '202-555-0105'),
92
- (2, '30 Memorial Drive, Avon MA 2322', '');
93
-
94
- INSERT INTO `comment` (`userId`, `text`) VALUES
95
- (1, 'From Robin #1'),
96
- (1, 'From Robin #2'),
97
- (2, 'From Taylor #1');
98
-
99
- INSERT INTO `book` (`userId`, `title`) VALUES
100
- (1, 'Beautiful'),
101
- (1, 'Lose Yourself'),
102
- (2, 'When Im Gone');
103
- ```
104
- 1. Build front-end JS.
105
- ```sh
106
- cd myapp/client
107
- npm install
108
- npm run build
109
- ```
110
- 1. Next, you need to set how the database is connected.
111
- The database connection method can be set in config/database.js, so change it according to your environment.
112
- See [here](https://sequelize.org/docs/v6/other-topics/migrations/#cfg) for details.
113
- ```js
114
- // For ESM, use "export default".
115
- //export default {
116
- module.exports = {
117
- development: {
118
- username: 'root',
119
- password: 'password',
120
- database: 'express_sweet_db',
121
- host: 'localhost',
122
- dialect: 'mariadb'
123
- },
124
- test: {
125
- username: 'root',
126
- password: 'password',
127
- database: 'express_sweet_db',
128
- host: 'localhost',
129
- dialect: 'mariadb'
130
- },
131
- production: {
132
- username: 'root',
133
- password: 'password',
134
- database: 'express_sweet_db',
135
- host: 'localhost',
136
- dialect: 'mariadb'
137
- }
138
- }
139
- ```
140
- 1. The DB to be used can be defined individually for each environment.
141
- Specify the environment in the .env file.
142
- ```js
143
- NODE_ENV=development
144
- ```
145
- 1. Launch the application.
146
- ```sh
147
- cd myapp
148
- npm start
149
- ```
Binary file
Binary file
Binary file
Binary file