befly 3.9.10 → 3.9.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "befly",
3
- "version": "3.9.10",
3
+ "version": "3.9.11",
4
4
  "description": "Befly - 为 Bun 专属打造的 TypeScript API 接口框架核心引擎",
5
5
  "type": "module",
6
6
  "private": false,
@@ -74,7 +74,7 @@
74
74
  "pino": "^10.1.0",
75
75
  "pino-roll": "^4.0.0"
76
76
  },
77
- "gitHead": "c521a468291c1555672e972db43021dda1763402",
77
+ "gitHead": "7efd464153a6813d2eabbed638bc7475ec558e5e",
78
78
  "devDependencies": {
79
79
  "typescript": "^5.9.3"
80
80
  }
package/router/api.ts CHANGED
@@ -33,6 +33,7 @@ export function apiHandler(apis: Map<string, ApiRoute>, hooks: Hook[], context:
33
33
  const clientIp = req.headers.get('x-forwarded-for')?.split(',')[0]?.trim() || req.headers.get('x-real-ip') || 'unknown';
34
34
 
35
35
  const ctx: RequestContext = {
36
+ method: req.method,
36
37
  body: {},
37
38
  user: {},
38
39
  req: req,
@@ -8,6 +8,8 @@ import type { ApiRoute } from './api.js';
8
8
  * 请求上下文接口
9
9
  */
10
10
  export interface RequestContext {
11
+ /** 请求方法 (GET/POST) */
12
+ method: string;
11
13
  /** 请求体参数 */
12
14
  body: Record<string, any>;
13
15
  /** 用户信息 */