@seip/blue-bird 0.9.5 → 0.9.7

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/core/cache.js CHANGED
@@ -45,7 +45,7 @@ async function initRedis() {
45
45
  }
46
46
  }
47
47
 
48
- initRedis().catch(() => {});
48
+ initRedis().catch(() => { });
49
49
 
50
50
  setInterval(() => {
51
51
  const now = Date.now();
@@ -70,7 +70,7 @@ class Cache {
70
70
  const key = req.originalUrl;
71
71
 
72
72
  if (redisHost && !redisClient) {
73
- await initRedis().catch(() => {});
73
+ await initRedis().catch(() => { });
74
74
  }
75
75
 
76
76
  if (isRedisConnected && redisClient) {
@@ -79,6 +79,7 @@ class Cache {
79
79
  if (cachedData) {
80
80
  const cached = JSON.parse(cachedData);
81
81
  if (cached.type === "json") {
82
+ res.set("X-Blue-Bird-Cache", "HIT");
82
83
  return res.json(cached.data);
83
84
  } else {
84
85
  res.type("text/html");
@@ -15,7 +15,7 @@ services:
15
15
  environment:
16
16
  - NODE_ENV=production
17
17
  - DEBUG=false
18
- - DATABASE_URL=mysql://${DB_USER:-root}:${DB_PASSWORD:-root}@mysql:${DB_PORT:-3306}/${DB_NAME:-blue_bird}
18
+ - DATABASE_URL=mysql://${DB_USER:-root}:${DB_PASSWORD:-root}@mysql:3306/${DB_NAME:-blue_bird}
19
19
  - REDIS_HOST=redis
20
20
  - REDIS_PORT=6379
21
21
  - PORT=3000
@@ -58,7 +58,7 @@ services:
58
58
  volumes:
59
59
  - mysql_data:/var/lib/mysql
60
60
  healthcheck:
61
- test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-root}"]
61
+ test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-root}" ]
62
62
  interval: 10s
63
63
  timeout: 5s
64
64
  retries: 5
@@ -77,7 +77,7 @@ services:
77
77
  networks:
78
78
  - bluebird_net
79
79
  healthcheck:
80
- test: ["CMD", "redis-cli", "ping"]
80
+ test: [ "CMD", "redis-cli", "ping" ]
81
81
  interval: 5s
82
82
  timeout: 3s
83
83
  retries: 5
@@ -15,7 +15,7 @@ services:
15
15
  environment:
16
16
  - NODE_ENV=production
17
17
  - DEBUG=false
18
- - DATABASE_URL=postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-root}@postgres:${DB_PORT:-5432}/${DB_NAME:-blue_bird}?schema=public
18
+ - DATABASE_URL=postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-root}@postgres:5432/${DB_NAME:-blue_bird}?schema=public
19
19
  - REDIS_HOST=redis
20
20
  - REDIS_PORT=6379
21
21
  - PORT=3000
@@ -59,7 +59,7 @@ services:
59
59
  volumes:
60
60
  - postgres_data:/var/lib/postgresql
61
61
  healthcheck:
62
- test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-blue_bird}"]
62
+ test: [ "CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-blue_bird}" ]
63
63
  interval: 10s
64
64
  timeout: 5s
65
65
  retries: 5
@@ -78,7 +78,7 @@ services:
78
78
  networks:
79
79
  - bluebird_net
80
80
  healthcheck:
81
- test: ["CMD", "redis-cli", "ping"]
81
+ test: [ "CMD", "redis-cli", "ping" ]
82
82
  interval: 5s
83
83
  timeout: 3s
84
84
  retries: 5
@@ -15,7 +15,7 @@ services:
15
15
  environment:
16
16
  - NODE_ENV=production
17
17
  - DEBUG=false
18
- - DATABASE_URL=mysql://${DB_USER:-root}:${DB_PASSWORD:-root}@mysql:${DB_PORT:-3306}/${DB_NAME:-blue_bird}
18
+ - DATABASE_URL=mysql://${DB_USER:-root}:${DB_PASSWORD:-root}@mysql:3306/${DB_NAME:-blue_bird}
19
19
  - REDIS_HOST=redis
20
20
  - REDIS_PORT=6379
21
21
  - PORT=3000
@@ -58,7 +58,7 @@ services:
58
58
  volumes:
59
59
  - mysql_data:/var/lib/mysql
60
60
  healthcheck:
61
- test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-root}"]
61
+ test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-root}" ]
62
62
  interval: 10s
63
63
  timeout: 5s
64
64
  retries: 5
@@ -77,7 +77,7 @@ services:
77
77
  networks:
78
78
  - bluebird_net
79
79
  healthcheck:
80
- test: ["CMD", "redis-cli", "ping"]
80
+ test: [ "CMD", "redis-cli", "ping" ]
81
81
  interval: 5s
82
82
  timeout: 3s
83
83
  retries: 5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seip/blue-bird",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "Express opinionated API framework with built-in JWT auth, validation, and caching",
5
5
  "type": "module",
6
6
  "types": "core/index.d.ts",