@anteros/core 0.0.32 → 0.0.33
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/package.json +1 -1
- package/server/boot.ts +15 -0
package/package.json
CHANGED
package/server/boot.ts
CHANGED
|
@@ -245,6 +245,21 @@ async function bootApp(options: BootAppOptions = {} as BootAppOptions) {
|
|
|
245
245
|
box += `${NAME}`.gray.underline + ` (PID: ${process.pid}) — ${role}\n\n`
|
|
246
246
|
box += `Env: ${env || 'dev'}`.green.bold + '\n'
|
|
247
247
|
box += `reusePort: ${(reusePort || isWorker) ? 'On'.green.bold : 'Off'.red.bold}\n`.gray.bold
|
|
248
|
+
|
|
249
|
+
// DB query cache status (server.cache) — driver: memory | filesystem | redis
|
|
250
|
+
const cacheCfg = cfg.server.cache;
|
|
251
|
+
// any: @colors/colors type les styles chaînés (.red.bold) comme des fonctions Color
|
|
252
|
+
let cacheInfo: any = 'Off'.red.bold;
|
|
253
|
+
if (cacheCfg?.enabled) {
|
|
254
|
+
const driver = cacheCfg.driver ?? 'memory';
|
|
255
|
+
const detail = driver === 'filesystem'
|
|
256
|
+
? ` ${cacheCfg.directory ?? './.cache'}`
|
|
257
|
+
: driver === 'redis'
|
|
258
|
+
? ` ${cacheCfg.redis?.host ?? 'localhost'}${cacheCfg.redis?.port ? `:${cacheCfg.redis.port}` : ''}`
|
|
259
|
+
: '';
|
|
260
|
+
cacheInfo = `On`.green.bold + ` (${driver}${detail})`;
|
|
261
|
+
}
|
|
262
|
+
box += `Cache: ${cacheInfo}`.gray.bold + '\n'
|
|
248
263
|
box += `Url: http://localhost:${PORT}`.gray.bold;
|
|
249
264
|
box += '\n\n';
|
|
250
265
|
box += `Last boot: 🔄 ${dayjs().format('YYYY-MM-DD HH:mm:ss')}`.gray;
|