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/CHANGELOG.md +26 -2
- package/INSTALL-Redis.md +51 -0
- package/dist/build.common.js +10 -4
- package/dist/build.esm.js +10 -4
- package/docs/index.html +42 -5
- package/docs/templates/cjs/authentication.js +96 -0
- package/docs/templates/cjs/config.js +78 -0
- package/docs/templates/cjs/database.js +35 -0
- package/docs/templates/cjs/view.js +36 -0
- package/docs/templates/esm/authentication.js +96 -0
- package/docs/templates/esm/config.js +78 -0
- package/docs/templates/esm/database.js +35 -0
- package/docs/templates/esm/view.js +36 -0
- package/package.json +9 -6
- package/types/interfaces/AuthenticationOptions.d.ts +13 -0
- package/types/middlewares/CORS.d.ts +1 -1
- package/types/package.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
|
|
3
2
|
All notable changes to this project will be documented in this file.
|
|
4
3
|
|
|
4
|
+
## [1.0.18] - 2022-05-18
|
|
5
|
+
### Fixed
|
|
6
|
+
- User authentication sessions can now be stored in redis.
|
|
7
|
+
To use redis for session storage, simply add the following option to config/authentication.js.
|
|
8
|
+
Please give it a try.
|
|
9
|
+
|
|
10
|
+
config/authentication.js:
|
|
11
|
+
```json
|
|
12
|
+
/**
|
|
13
|
+
* The session store instance, defaults to a new MemoryStore(memory) instance.
|
|
14
|
+
* @type {'memory|redis'}
|
|
15
|
+
*/
|
|
16
|
+
session_store: 'memory',
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* If the session is stored in "redis", this field is required and should be set to the hostname of the Redis server.
|
|
20
|
+
* For example, to connect to redis on localhost on port 6379, set "redis://localhost:6379".
|
|
21
|
+
* To connect to a different host or port, use a connection string in the format "redis[s]://[[username][:password]@][host][:port][/db-number]".
|
|
22
|
+
* For example, "redis://alice:foobared@awesome.redis.server:6380".
|
|
23
|
+
* @type {string|undefined}
|
|
24
|
+
*/
|
|
25
|
+
redis_host: 'redis://localhost:6379'
|
|
26
|
+
```
|
|
27
|
+
|
|
5
28
|
## [1.0.17] - 2022-05-17
|
|
6
29
|
### Fixed
|
|
7
30
|
- Updated documentation and refactored variable names.
|
|
@@ -188,4 +211,5 @@ All notable changes to this project will be documented in this file.
|
|
|
188
211
|
[1.0.14]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.13...v1.0.14
|
|
189
212
|
[1.0.15]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.14...v1.0.15
|
|
190
213
|
[1.0.16]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.15...v1.0.16
|
|
191
|
-
[1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
|
|
214
|
+
[1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
|
|
215
|
+
[1.0.18]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.17...v1.0.18
|
package/INSTALL-Redis.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Install Redis
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
* OS: `Amazon Linux 2`
|
|
5
|
+
* Redis: `v6.2.6 or later`
|
|
6
|
+
* see more: https://redis.io/download#installation
|
|
7
|
+
|
|
8
|
+
Check the version of Redis that can be installed.
|
|
9
|
+
```sh
|
|
10
|
+
amazon-linux-extras list|grep redis
|
|
11
|
+
# Below is an example of the output.
|
|
12
|
+
# 56 redis6 available [ =stable ]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Install Redis by specifying the version.
|
|
16
|
+
```sh
|
|
17
|
+
sudo amazon-linux-extras install -y redis6
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Configure and start Redis autostart.
|
|
21
|
+
```sh
|
|
22
|
+
sudo systemctl status redis.service
|
|
23
|
+
sudo systemctl start redis.service
|
|
24
|
+
sudo systemctl enable redis.service
|
|
25
|
+
sudo systemctl is-enabled redis.service
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Check Redis process.
|
|
29
|
+
```sh
|
|
30
|
+
ps -ef | grep redis | grep -v grep
|
|
31
|
+
# Below is an example of the output.
|
|
32
|
+
# redis 5407 1 0 11:02 ? 00:00:00 /usr/bin/redis-server 127.0.0.1:6379
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
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
|
+
|
|
42
|
+
Test Redis read/write.
|
|
43
|
+
```sh
|
|
44
|
+
redis-cli
|
|
45
|
+
|
|
46
|
+
set myMessage "hello world"
|
|
47
|
+
# OK
|
|
48
|
+
|
|
49
|
+
get myMessage
|
|
50
|
+
# "hello world"
|
|
51
|
+
```
|