express-sweet 1.0.17 → 1.0.18

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.
package/docs/index.html CHANGED
@@ -111,15 +111,23 @@
111
111
  </div>
112
112
  <hr class="mx-auto mx-lg-0 my-5">
113
113
  <p class="text-muted">
114
- Currently <a href="https://github.com/takuya-motoshima/express-sweet/releases/tag/v1.0.17" target="_blank">v1.0.17</a>
115
- <span class="px-1">•</span>
116
- <a href="#install">Install</a>
114
+ Currently <a href="https://github.com/takuya-motoshima/express-sweet/releases/tag/v1.0.18" target="_blank">v1.0.18</a>
117
115
  <span class="px-1">•</span>
118
116
  <a href="#quick-start">Quick Start</a>
119
117
  <span class="px-1">•</span>
120
- <a href="#usage">Usage</a>
118
+ <a href="#environment-variable">Environment variable</a>
119
+ <span class="px-1">•</span>
120
+ <a href="#base-configuration">Base configuration</a>
121
+ <span class="px-1">•</span>
122
+ <a href="#routing">Routing</a>
123
+ <span class="px-1">•</span>
124
+ <a href="#views">Views</a>
121
125
  <span class="px-1">•</span>
122
- <a href="#api">PDFLiveElement API</a>
126
+ <a href="#model">Model</a>
127
+ <span class="px-1">•</span>
128
+ <a href="#user-authentication">User authentication</a>
129
+ <span class="px-1">•</span>
130
+ <a href="#rekognition">Rekognition</a>
123
131
  <span class="px-1">•</span>
124
132
  <a href="https://github.com/takuya-motoshima/express-sweet" target="_blank">GitHub repo</a>
125
133
  <span class="px-1">•</span>
@@ -337,6 +345,10 @@ INSERT INTO `book` (`userId`, `title`) VALUES
337
345
  <!-- begin::Base configuration -->
338
346
  <h1 id="base-configuration">Base configuration</h1>
339
347
  <p>The basic configuration of Express Sweet is defined in the <code>config/config.js</code> file.</p>
348
+ <div class="callout callout-info">
349
+ Click <a href="templates/esm/config.js" download="config.js">here</a> to download a sample <span class="fw-bolder">ESM</span> configuration and<br>
350
+ <a href="templates/cjs/config.js" download="config.js">here</a> to download a sample <span class="fw-bolder">CJS</span> configuration.
351
+ </div>
340
352
  <ul class="list-group list-group-flush">
341
353
  <li class="list-group-item">
342
354
  <div class="fw-bold"><code class="h5">env_path</code></div>
@@ -665,6 +677,10 @@ module.exports = router;</code></pre>
665
677
  </p>
666
678
  <h2 id="views-configuration">Configuration</h2>
667
679
  <p>The view (template engine) configuration is defined in the <code>"config/view.js"</code> file.</p>
680
+ <div class="callout callout-info">
681
+ Click <a href="templates/esm/view.js" download="view.js">here</a> to download a sample <span class="fw-bolder">ESM</span> configuration and<br>
682
+ <a href="templates/cjs/view.js" download="view.js">here</a> to download a sample <span class="fw-bolder">CJS</span> configuration.
683
+ </div>
668
684
  <ul class="list-group list-group-flush">
669
685
  <li class="list-group-item">
670
686
  <div class="fw-bold"><code class="h5">views_dir</code></div>
@@ -1304,6 +1320,10 @@ let val = &#039;2&#039;
1304
1320
  <p>This class provides a solid base from which to build your own models, allowing you to rapidly build out your application’s model layer.</p>
1305
1321
  <h2 id="model-configuration">Database configuration</h2>
1306
1322
  <p>The database configuration is defined in the <code>"config/database.js"</code> file.</p>
1323
+ <div class="callout callout-info">
1324
+ Click <a href="templates/esm/database.js" download="database.js">here</a> to download a sample <span class="fw-bolder">ESM</span> configuration and<br>
1325
+ <a href="templates/cjs/database.js" download="database.js">here</a> to download a sample <span class="fw-bolder">CJS</span> configuration.
1326
+ </div>
1307
1327
  <ul class="list-group list-group-flush">
1308
1328
  <li class="list-group-item">
1309
1329
  <div class="fw-bold"><code class="h5">username</code></div>
@@ -3218,6 +3238,10 @@ await BookModel.query(&quot;SELECT * FROM book&quot;, {type: BookModel.QueryType
3218
3238
  </p>
3219
3239
  <h2 id="user-authentication-configuration">Configuration</h2>
3220
3240
  <p>The user authentication configuration is defined in the <code>"config/authentication.js"</code> file.</p>
3241
+ <div class="callout callout-info">
3242
+ Click <a href="templates/esm/authentication.js" download="authentication.js">here</a> to download a sample <span class="fw-bolder">ESM</span> configuration and<br>
3243
+ <a href="templates/cjs/authentication.js" download="authentication.js">here</a> to download a sample <span class="fw-bolder">CJS</span> configuration.
3244
+ </div>
3221
3245
  <ul class="list-group list-group-flush">
3222
3246
  <li class="list-group-item">
3223
3247
  <div class="fw-bold h5"><code>boolean</code>enabled</div>
@@ -3226,6 +3250,19 @@ await BookModel.query(&quot;SELECT * FROM book&quot;, {type: BookModel.QueryType
3226
3250
  User authentication is enabled (<code>true</code>) by default.
3227
3251
  </div>
3228
3252
  </li>
3253
+ <li class="list-group-item">
3254
+ <div class="fw-bold h5"><code>&#039;memory&#039;|&#039;redis&#039;</code>session_store</div>
3255
+ <div class="ms-3">The session store instance, defaults to a new MemoryStore(<code>memory</code>) instance.</div>
3256
+ </li>
3257
+ <li class="list-group-item">
3258
+ <div class="fw-bold h5"><code>string|undefined</code>redis_host?</div>
3259
+ <div class="ms-3">
3260
+ If the session is stored in <code>&quot;redis&quot;</code>, this field is required and should be set to the hostname of the Redis server.
3261
+ For example, to connect to redis on localhost on port <code>6379</code>, set <code>&quot;redis://localhost:6379&quot;</code>.
3262
+ To connect to a different host or port, use a connection string in the format <code>&quot;redis[s]://[[username][:password]@][host][:port][/db-number]&quot;</code>.
3263
+ For example, <code>&quot;redis://alice:foobared@awesome.redis.server:6380&quot;</code>.
3264
+ </div>
3265
+ </li>
3229
3266
  <li class="list-group-item">
3230
3267
  <div class="fw-bold h5"><code>string</code>username</div>
3231
3268
  <div class="ms-3">
@@ -0,0 +1,96 @@
1
+ const UserModel = require('../models/UserModel');
2
+
3
+ /**
4
+ * User authentication configuration interface.
5
+ */
6
+ module.exports = {
7
+ /**
8
+ * Enable user authentication, defaults to disabled (false).
9
+ * @type {boolean}
10
+ */
11
+ enabled: true,
12
+
13
+ /**
14
+ * The session store instance, defaults to a new MemoryStore(memory) instance.
15
+ * @type {'memory|redis'}
16
+ */
17
+ session_store: 'memory',
18
+
19
+ /**
20
+ * If the session is stored in "redis", this field is required and should be set to the hostname of the Redis server.
21
+ * For example, to connect to redis on localhost on port 6379, set "redis://localhost:6379".
22
+ * To connect to a different host or port, use a connection string in the format "redis[s]://[[username][:password]@][host][:port][/db-number]".
23
+ * For example, "redis://alice:foobared@awesome.redis.server:6380".
24
+ * @type {string|undefined}
25
+ */
26
+ redis_host: undefined,
27
+
28
+ /**
29
+ * Authentication user ID field name, defaults to `username`.
30
+ * @type {string}
31
+ */
32
+ username: 'email',
33
+
34
+ /**
35
+ * Authentication password field name, defaults to `password`.
36
+ * @type {string}
37
+ */
38
+ password: 'password',
39
+
40
+ /**
41
+ * URL to redirect after successful authentication, defaults to `/`.
42
+ * @type {string}
43
+ */
44
+ success_redirect: '/',
45
+
46
+ /**
47
+ * URL to redirect after log off, defaults to `/login`.
48
+ * @type {string}
49
+ */
50
+ failure_redirect: '/login',
51
+
52
+ /**
53
+ * This hook is called when authenticating a user.
54
+ * Please find the user information that owns the credentials based on the user name and password you received and return it.
55
+ * If the user who owns the credentials cannot be found, return null.
56
+ *
57
+ * Note that the user information must include an ID value that can identify the user.
58
+ *
59
+ * @type {(username: string, password: string) => Promise<{[key: string]: any}|null>}
60
+ */
61
+ authenticate_user: async (username, password) => {
62
+ return UserModel.findOne({
63
+ where: {
64
+ email: username,
65
+ password: password
66
+ },
67
+ raw: true
68
+ });
69
+ },
70
+
71
+ /**
72
+ * This hook is called when user authentication is successful.
73
+ * Please search and return the authenticated user information to be set in the session based on the user ID of the parameter.
74
+ * The returned data will be set in the req.user property and the view's session variable.
75
+ *
76
+ * @type {(id: number|string) => Promise<{[key: string]: any}>}
77
+ */
78
+ subscribe_user: async (id) => {
79
+ return UserModel.findOne({
80
+ where: {id},
81
+ raw: true
82
+ });
83
+ },
84
+
85
+ /**
86
+ * URL without authentication. If the URL described in the access URL partially matches, authentication will not be performed, defaults to none.
87
+ * @type {(string|RegExp)[]}
88
+ */
89
+ allow_unauthenticated: ['/api'],
90
+
91
+ /**
92
+ * Authenticated user session expiration, defaults to 24 hours (24 * 3600000).
93
+ * @type {number}
94
+ */
95
+ expiration: 24 * 3600000
96
+ }
@@ -0,0 +1,78 @@
1
+ const path = require('path');
2
+
3
+ /**
4
+ * Express Sweet basic configuration interface.
5
+ */
6
+ module.exports = {
7
+ /**
8
+ * Environment variable file (.env) path, defaults to none (undefined).
9
+ * @type {string}
10
+ */
11
+ env_path: '.env',
12
+
13
+ /**
14
+ * CORS permission, defaults to invalid (false).
15
+ * @type {{enabled: boolean}}
16
+ */
17
+ cors_enabled: true,
18
+
19
+ /**
20
+ * Maximum body size you can request, defaults to `100kb`.
21
+ * @type {string|number}
22
+ */
23
+ max_body_size: '100kb',
24
+
25
+ /**
26
+ * Absolute path to the router directory, defaults to `<application root directory>/routes`.
27
+ * @type {string}
28
+ */
29
+ router_dir: path.join(process.cwd(), 'routes'),
30
+
31
+ /**
32
+ * The endpoint to run when the root URL is requested, defaults to none (undefined).
33
+ * @type {string}
34
+ */
35
+ default_router: '/home',
36
+
37
+ /**
38
+ * This is a hook that rewrites the base URL.
39
+ * 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.
40
+ * The default value is the referrer's origin (eg https://example.com).
41
+ *
42
+ * @example
43
+ * rewrite_base_url: baseUrl => {
44
+ * return `${baseUrl}/admin`;
45
+ * }
46
+ *
47
+ * @type {(baseUrl: string): string}
48
+ */
49
+ rewrite_base_url: baseUrl => {
50
+ return baseUrl;
51
+ },
52
+
53
+ /**
54
+ * This is a hook for error handling.
55
+ * For example, you can use it when you want to send an external notification of the error received by this hook.
56
+ *
57
+ * @example
58
+ * error_handler: async err => {
59
+ * // Notify system administrator of error.
60
+ * return new Promise((resolve, reject) => {
61
+ * const sendmail = require('sendmail')();
62
+ * sendmail({
63
+ * from: 'no-reply@example.com',
64
+ * to: 'administrator@example.com',
65
+ * subject: 'Error occurred',
66
+ * text: err.message
67
+ * }, err => {
68
+ * err ? reject(err) : resolve();
69
+ * });
70
+ * });
71
+ * }
72
+ *
73
+ * @type {(err: any): void|Promise<void>}
74
+ */
75
+ error_handler: err => {
76
+ console.error(`An error has occurred. Error message: ${err.message}`);
77
+ }
78
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Database configuration.
3
+ */
4
+ module.exports = {
5
+ development: {
6
+ username: 'root',
7
+ password: 'password',
8
+ database: 'mydb',
9
+ host: 'localhost',
10
+ port: undefined,
11
+ dialect: 'mariadb',
12
+ timezone: '+09:00',
13
+ logging: false
14
+ },
15
+ test: {
16
+ username: 'root',
17
+ password: 'password',
18
+ database: 'mydb',
19
+ host: 'localhost',
20
+ port: undefined,
21
+ dialect: 'mariadb',
22
+ timezone: '+09:00',
23
+ logging: false
24
+ },
25
+ production: {
26
+ username: 'root',
27
+ password: 'password',
28
+ database: 'mydb',
29
+ host: 'localhost',
30
+ port: undefined,
31
+ dialect: 'mariadb',
32
+ timezone: '+09:00',
33
+ logging: false
34
+ }
35
+ }
@@ -0,0 +1,36 @@
1
+ const path = require('path');
2
+
3
+ /**
4
+ * View's configuration interface.
5
+ */
6
+ module.exports = {
7
+ /**
8
+ * Absolute path to the directory where the view files are located, defaults to `<application root directory>/views`.
9
+ * @type {string}
10
+ */
11
+ views_dir: path.join(process.cwd(), 'views'),
12
+
13
+ /**
14
+ * Path to partials templates, one or several directories, defaults to `<application root directory>/views/partials`.
15
+ * @type {string|string[]}
16
+ */
17
+ partials_dir: path.join(process.cwd(), 'views/partials'),
18
+
19
+ /**
20
+ * Path to layout templates, defaults to `<application root directory>/views/layout`.
21
+ * @type {string}
22
+ */
23
+ layouts_dir: path.join(process.cwd(), 'views/layout'),
24
+
25
+ /**
26
+ * Absolute path to default layout template. defaults to `<application root directory>/views/layout/default.hbs`.
27
+ * @type {string}
28
+ */
29
+ default_layout: path.join(process.cwd(), 'views/layout/default.hbs'),
30
+
31
+ /**
32
+ * Extension for templates & partials, defaults to `.hbs`,
33
+ * @type {string}
34
+ */
35
+ extension: '.hbs'
36
+ }
@@ -0,0 +1,96 @@
1
+ import UserModel from '../models/UserModel';
2
+
3
+ /**
4
+ * User authentication configuration interface.
5
+ */
6
+ export default {
7
+ /**
8
+ * Enable user authentication, defaults to disabled (false).
9
+ * @type {boolean}
10
+ */
11
+ enabled: true,
12
+
13
+ /**
14
+ * The session store instance, defaults to a new MemoryStore(memory) instance.
15
+ * @type {'memory|redis'}
16
+ */
17
+ session_store: 'memory',
18
+
19
+ /**
20
+ * If the session is stored in "redis", this field is required and should be set to the hostname of the Redis server.
21
+ * For example, to connect to redis on localhost on port 6379, set "redis://localhost:6379".
22
+ * To connect to a different host or port, use a connection string in the format "redis[s]://[[username][:password]@][host][:port][/db-number]".
23
+ * For example, "redis://alice:foobared@awesome.redis.server:6380".
24
+ * @type {string|undefined}
25
+ */
26
+ redis_host: undefined,
27
+
28
+ /**
29
+ * Authentication user ID field name, defaults to `username`.
30
+ * @type {string}
31
+ */
32
+ username: 'email',
33
+
34
+ /**
35
+ * Authentication password field name, defaults to `password`.
36
+ * @type {string}
37
+ */
38
+ password: 'password',
39
+
40
+ /**
41
+ * URL to redirect after successful authentication, defaults to `/`.
42
+ * @type {string}
43
+ */
44
+ success_redirect: '/',
45
+
46
+ /**
47
+ * URL to redirect after log off, defaults to `/login`.
48
+ * @type {string}
49
+ */
50
+ failure_redirect: '/login',
51
+
52
+ /**
53
+ * This hook is called when authenticating a user.
54
+ * Please find the user information that owns the credentials based on the user name and password you received and return it.
55
+ * If the user who owns the credentials cannot be found, return null.
56
+ *
57
+ * Note that the user information must include an ID value that can identify the user.
58
+ *
59
+ * @type {(username: string, password: string) => Promise<{[key: string]: any}|null>}
60
+ */
61
+ authenticate_user: async (username, password) => {
62
+ return UserModel.findOne({
63
+ where: {
64
+ email: username,
65
+ password: password
66
+ },
67
+ raw: true
68
+ });
69
+ },
70
+
71
+ /**
72
+ * This hook is called when user authentication is successful.
73
+ * Please search and return the authenticated user information to be set in the session based on the user ID of the parameter.
74
+ * The returned data will be set in the req.user property and the view's session variable.
75
+ *
76
+ * @type {(id: number|string) => Promise<{[key: string]: any}>}
77
+ */
78
+ subscribe_user: async (id) => {
79
+ return UserModel.findOne({
80
+ where: {id},
81
+ raw: true
82
+ });
83
+ },
84
+
85
+ /**
86
+ * URL without authentication. If the URL described in the access URL partially matches, authentication will not be performed, defaults to none.
87
+ * @type {(string|RegExp)[]}
88
+ */
89
+ allow_unauthenticated: ['/api'],
90
+
91
+ /**
92
+ * Authenticated user session expiration, defaults to 24 hours (24 * 3600000).
93
+ * @type {number}
94
+ */
95
+ expiration: 24 * 3600000
96
+ }
@@ -0,0 +1,78 @@
1
+ import path from 'path';
2
+
3
+ /**
4
+ * Express Sweet basic configuration interface.
5
+ */
6
+ export default {
7
+ /**
8
+ * Environment variable file (.env) path, defaults to none (undefined).
9
+ * @type {string}
10
+ */
11
+ env_path: '.env',
12
+
13
+ /**
14
+ * CORS permission, defaults to invalid (false).
15
+ * @type {{enabled: boolean}}
16
+ */
17
+ cors_enabled: true,
18
+
19
+ /**
20
+ * Maximum body size you can request, defaults to `100kb`.
21
+ * @type {string|number}
22
+ */
23
+ max_body_size: '100kb',
24
+
25
+ /**
26
+ * Absolute path to the router directory, defaults to `<application root directory>/routes`.
27
+ * @type {string}
28
+ */
29
+ router_dir: path.join(process.cwd(), 'routes'),
30
+
31
+ /**
32
+ * The endpoint to run when the root URL is requested, defaults to none (undefined).
33
+ * @type {string}
34
+ */
35
+ default_router: '/home',
36
+
37
+ /**
38
+ * This is a hook that rewrites the base URL.
39
+ * 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.
40
+ * The default value is the referrer's origin (eg https://example.com).
41
+ *
42
+ * @example
43
+ * rewrite_base_url: baseUrl => {
44
+ * return `${baseUrl}/admin`;
45
+ * }
46
+ *
47
+ * @type {(baseUrl: string): string}
48
+ */
49
+ rewrite_base_url: baseUrl => {
50
+ return baseUrl;
51
+ },
52
+
53
+ /**
54
+ * This is a hook for error handling.
55
+ * For example, you can use it when you want to send an external notification of the error received by this hook.
56
+ *
57
+ * @example
58
+ * error_handler: async err => {
59
+ * // Notify system administrator of error.
60
+ * return new Promise((resolve, reject) => {
61
+ * const sendmail = require('sendmail')();
62
+ * sendmail({
63
+ * from: 'no-reply@example.com',
64
+ * to: 'administrator@example.com',
65
+ * subject: 'Error occurred',
66
+ * text: err.message
67
+ * }, err => {
68
+ * err ? reject(err) : resolve();
69
+ * });
70
+ * });
71
+ * }
72
+ *
73
+ * @type {(err: any): void|Promise<void>}
74
+ */
75
+ error_handler: err => {
76
+ console.error(`An error has occurred. Error message: ${err.message}`);
77
+ }
78
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Database configuration.
3
+ */
4
+ export default {
5
+ development: {
6
+ username: 'root',
7
+ password: 'password',
8
+ database: 'mydb',
9
+ host: 'localhost',
10
+ port: undefined,
11
+ dialect: 'mariadb',
12
+ timezone: '+09:00',
13
+ logging: false
14
+ },
15
+ test: {
16
+ username: 'root',
17
+ password: 'password',
18
+ database: 'mydb',
19
+ host: 'localhost',
20
+ port: undefined,
21
+ dialect: 'mariadb',
22
+ timezone: '+09:00',
23
+ logging: false
24
+ },
25
+ production: {
26
+ username: 'root',
27
+ password: 'password',
28
+ database: 'mydb',
29
+ host: 'localhost',
30
+ port: undefined,
31
+ dialect: 'mariadb',
32
+ timezone: '+09:00',
33
+ logging: false
34
+ }
35
+ }
@@ -0,0 +1,36 @@
1
+ import path from 'path';
2
+
3
+ /**
4
+ * View's configuration interface.
5
+ */
6
+ export default {
7
+ /**
8
+ * Absolute path to the directory where the view files are located, defaults to `<application root directory>/views`.
9
+ * @type {string}
10
+ */
11
+ views_dir: path.join(process.cwd(), 'views'),
12
+
13
+ /**
14
+ * Path to partials templates, one or several directories, defaults to `<application root directory>/views/partials`.
15
+ * @type {string|string[]}
16
+ */
17
+ partials_dir: path.join(process.cwd(), 'views/partials'),
18
+
19
+ /**
20
+ * Path to layout templates, defaults to `<application root directory>/views/layout`.
21
+ * @type {string}
22
+ */
23
+ layouts_dir: path.join(process.cwd(), 'views/layout'),
24
+
25
+ /**
26
+ * Absolute path to default layout template. defaults to `<application root directory>/views/layout/default.hbs`.
27
+ * @type {string}
28
+ */
29
+ default_layout: path.join(process.cwd(), 'views/layout/default.hbs'),
30
+
31
+ /**
32
+ * Extension for templates & partials, defaults to `.hbs`,
33
+ * @type {string}
34
+ */
35
+ extension: '.hbs'
36
+ }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "express-sweet",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Extend Express functionality with Express Sweet and start developing fast, minimal web applications.",
5
5
  "main": "dist/build.common.js",
6
6
  "module": "dist/build.esm.js",
7
7
  "types": "types/index.d.ts",
8
8
  "files": [
9
- "LICENSE",
10
- "README.md",
11
- "CHANGELOG.md",
12
9
  "dist/",
13
10
  "docs/",
14
- "example/",
15
11
  "types/",
16
- "package.json"
12
+ "CHANGELOG.md",
13
+ "INSTALL-Redis.md",
14
+ "LICENSE",
15
+ "package.json",
16
+ "README.md"
17
17
  ],
18
18
  "scripts": {
19
19
  "watch": "node --max-old-space-size=8192 node_modules/rollup/dist/bin/rollup -c rollup.config.js --watch",
@@ -68,6 +68,7 @@
68
68
  "body-parser": "^1.19.0",
69
69
  "class-transformer": "^0.2.3",
70
70
  "class-validator": "^0.12.2",
71
+ "connect-redis": "^6.1.3",
71
72
  "cookie-parser": "~1.4.4",
72
73
  "cors": "^2.8.5",
73
74
  "debug": "~2.6.9",
@@ -90,12 +91,14 @@
90
91
  "nodejs-shared": "^1.0.2",
91
92
  "passport": "^0.4.1",
92
93
  "passport-local": "^1.0.0",
94
+ "redis": "^4.1.0",
93
95
  "reflect-metadata": "^0.1.13",
94
96
  "sequelize": "^5.22.4",
95
97
  "uniqid": "^5.2.0"
96
98
  },
97
99
  "devDependencies": {
98
100
  "@types/aws-sdk": "^2.7.0",
101
+ "@types/connect-redis": "^0.0.18",
99
102
  "@types/cookie-parser": "^1.4.2",
100
103
  "@types/debug": "^4.1.5",
101
104
  "@types/express": "^4.17.11",
@@ -7,6 +7,19 @@ export default interface {
7
7
  * @type {boolean}
8
8
  */
9
9
  enabled: boolean;
10
+ /**
11
+ * The session store instance, defaults to a new MemoryStore(memory) instance.
12
+ * @type {'memory'|'redis'}
13
+ */
14
+ session_store: 'memory' | 'redis';
15
+ /**
16
+ * If the session is stored in "redis", this field is required and should be set to the hostname of the Redis server.
17
+ * For example, to connect to redis on localhost on port 6379, set "redis://localhost:6379".
18
+ * To connect to a different host or port, use a connection string in the format "redis[s]://[[username][:password]@][host][:port][/db-number]".
19
+ * For example, "redis://alice:foobared@awesome.redis.server:6380".
20
+ * @type {string|undefined}
21
+ */
22
+ redis_host?: string;
10
23
  /**
11
24
  * Authentication user ID field name, defaults to `username`.
12
25
  * @type {string}
@@ -6,7 +6,7 @@ export default class {
6
6
  /**
7
7
  * Mount on application.
8
8
  */
9
- static mount(app: express.Express): undefined;
9
+ static mount(app: express.Express): void;
10
10
  /**
11
11
  * Returns the option.
12
12
  *