huxy-node-server 1.0.0-beta.1 → 1.0.0-beta.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huxy-node-server",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "一个精炼、高性能的 Express.js 服务器模板,为现代 Node.js 应用程序设计,提供灵活的功能和最佳实践。",
5
5
  "type": "module",
6
6
  "module": "./src/index.js",
package/src/index.js CHANGED
@@ -5,7 +5,7 @@ import {rateLimit as K, ipKeyGenerator as W} from 'express-rate-limit';
5
5
  import z from 'compression';
6
6
  import X from 'pino-http';
7
7
  import {createServer as B} from 'node:http';
8
- import U from 'pino';
8
+ import k from 'pino';
9
9
  import w from 'node:os';
10
10
  import D from 'node:net';
11
11
  var m = (t = new Date()) => t.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai', hour12: !1}),
@@ -47,7 +47,7 @@ var m = (t = new Date()) => t.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai'
47
47
  u = (t = {}, o = H) => {
48
48
  let {env: e} = process;
49
49
  Object.keys(o).map(n => {
50
- let s = e[n];
50
+ let s = e[n] ?? t[n];
51
51
  s && M(o[n], s, t);
52
52
  });
53
53
  let r = {...t, ...x()};
@@ -65,7 +65,7 @@ var m = (t = new Date()) => t.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai'
65
65
  r.listen(Number(t), o));
66
66
  });
67
67
  import 'dotenv';
68
- var k = {
68
+ var U = {
69
69
  nodeEnv: 'production',
70
70
  isDev: !1,
71
71
  port: parseInt(process.env.PORT || '3000', 10),
@@ -83,9 +83,9 @@ var k = {
83
83
  },
84
84
  logLevel: process.env.LOG_LEVEL || 30,
85
85
  },
86
- f = k;
86
+ f = U;
87
87
  var c = (t, o) =>
88
- U({
88
+ k({
89
89
  name: t,
90
90
  level: f.logLevel,
91
91
  transport: {target: 'pino-pretty', options: {colorize: !0, sync: !0}, ignore: 'pid,hostname,level,time', translateTime: 'UTC:yyyy-mm-dd HH:MM:ss', customColors: 'err:red,info:blue'},