@fastcar/koa 0.1.21 → 0.1.23

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/README.md CHANGED
@@ -1,115 +1,453 @@
1
- # 基于封装koa的web成型框架
1
+ # @fastcar/koa
2
2
 
3
- ## 快速安装
3
+ 基于 [@fastcar/core](https://github.com/williamDazhangyu/fast-car) 框架的 Koa Web 服务封装组件,提供装饰器驱动的路由定义和中间件管理。
4
4
 
5
+ ## 目录
6
+
7
+ - [特性](#特性)
8
+ - [安装](#安装)
9
+ - [快速开始](#快速开始)
10
+ - [配置](#配置)
11
+ - [装饰器/API 参考](#装饰器api-参考)
12
+ - [内置中间件](#内置中间件)
13
+ - [示例](#示例)
14
+ - [类型定义](#类型定义)
15
+ - [依赖关系](#依赖关系)
16
+ - [许可证](#许可证)
17
+
18
+ ## 特性
19
+
20
+ - 🎯 **装饰器驱动**: 使用 TypeScript 装饰器定义路由和中间件
21
+ - 🔌 **模块化中间件**: 支持自定义和内置中间件,按声明顺序加载
22
+ - 🚀 **自动依赖注入**: 集成 @fastcar/core 的 IoC 容器
23
+ - 📁 **静态文件服务**: 内置静态文件和文件上传支持
24
+ - 🛡️ **全局异常处理**: 内置异常捕获中间件
25
+ - 📚 **Swagger 文档**: 支持 API 文档自动生成(需安装 swagger-ui-dist)
26
+ - 🔄 **代理支持**: 内置反向代理中间件
27
+
28
+ ## 安装
29
+
30
+ ```bash
5
31
  npm install @fastcar/koa
32
+ # 或
33
+ yarn add @fastcar/koa
34
+ ```
35
+
36
+ ### 必需依赖
37
+
38
+ ```bash
39
+ npm install @fastcar/core @fastcar/server koa @koa/router
40
+ ```
41
+
42
+ ### 可选依赖
43
+
44
+ 根据功能需要安装:
45
+
46
+ ```bash
47
+ # 文件上传
48
+ npm install @koa/multer multer
49
+
50
+ # 静态文件服务
51
+ npm install koa-static koa-range koa-mount
52
+
53
+ # 跨域支持
54
+ npm install koa2-cors
6
55
 
7
- ## 基本原理
56
+ # 请求体解析
57
+ npm install @koa/bodyparser koa-body
8
58
 
9
- * 采用@fastcar/core框架,然后将koa包装成一个基础组件进行调用
10
- * 加载顺序为优先加载自定义中间件->加载自定义路由->启动http服务进行监听
11
- * 停止阶段 延迟一秒左右 将server进行关闭
59
+ # 反向代理
60
+ npm install http-proxy-middleware koa2-connect
12
61
 
13
- ## 如何使用
62
+ # API 文档
63
+ npm install swagger-ui-dist
14
64
 
15
- ```ts
65
+ # 类型定义(TypeScript 项目)
66
+ npm install -D @types/koa @types/koa__multer @types/koa-mount @types/koa-range @types/koa-static @types/koa2-cors
67
+ ```
68
+
69
+ ## 快速开始
70
+
71
+ ### 1. 创建应用入口
72
+
73
+ ```typescript
16
74
  import { FastCarApplication } from "@fastcar/core";
17
75
  import { Application } from "@fastcar/core/annotation";
18
- import { EnableKoa } from "@fastcar/koa/annotation";
19
-
20
- @Application //注入基础框架
21
- @EnableKoa //开启koa
22
- class APP {
23
- app!: FastCarApplication;
76
+ import { EnableKoa, KoaMiddleware } from "@fastcar/koa/annotation";
77
+ import { ExceptionGlobalHandler, KoaBodyParser } from "@fastcar/koa";
78
+
79
+ @Application
80
+ @EnableKoa
81
+ @KoaMiddleware(ExceptionGlobalHandler, KoaBodyParser)
82
+ class App {
83
+ app!: FastCarApplication;
24
84
  }
25
85
 
26
- export const app = new APP();
86
+ export const app = new App();
27
87
  ```
28
88
 
29
- ## 添加一个路由访问
89
+ ### 2. 创建控制器
30
90
 
31
- ```ts
91
+ ```typescript
32
92
  import { Controller } from "@fastcar/core/annotation";
33
- import { GET } from "@fastcar/koa/annotation";
93
+ import { GET, POST, RequestMapping } from "@fastcar/koa/annotation";
34
94
  import { Context } from "koa";
35
95
 
36
-
37
96
  @Controller
38
- export default class HelloController {
39
-
40
- @GET("/")
41
- home(params: string, ctx: Context) {
42
- console.log("这边请注意 params是params和body二合一的参数 重名的值会优先取body的");
43
- console.log('body取 ctx.request.body');
44
- console.log('路径后参数取ctx.params');
45
- return "hello world";
46
- }
97
+ @RequestMapping("/api") // 基础路径前缀
98
+ export default class UserController {
99
+
100
+ @GET("/users")
101
+ async listUsers() {
102
+ return { code: 200, data: [] };
103
+ }
104
+
105
+ @POST("/users")
106
+ async createUser(data: any, ctx: Context) {
107
+ // data 自动合并了 query、body 和 params
108
+ return { code: 200, data: { id: 1, ...data } };
109
+ }
110
+
111
+ @GET("/users/:id")
112
+ async getUser(data: { id: string }, ctx: Context) {
113
+ // URL 参数在 ctx.params 中
114
+ const userId = ctx.params.id;
115
+ return { code: 200, data: { id: userId } };
116
+ }
117
+
118
+ @HEAD("/users/:id")
119
+ async checkUserExists(data: { id: string }, ctx: Context) {
120
+ // HEAD 请求通常用于检查资源是否存在,不返回响应体
121
+ const userId = ctx.params.id;
122
+ const exists = await checkUser(userId); // 假设的检查方法
123
+ ctx.status = exists ? 200 : 404;
124
+ }
47
125
  }
48
126
  ```
49
127
 
50
- ## 如何引用koa中间件
128
+ ### 3. 配置文件 (application.yaml)
129
+
130
+ ```yaml
131
+ koa:
132
+ server:
133
+ port: 3000
134
+ hostname: "0.0.0.0"
135
+ koaStatic:
136
+ "/static": "./resource/static" # 路径别名映射
137
+ koaBodyOptions:
138
+ multipart: true
139
+ formidable:
140
+ maxFileSize: 200 * 1024 * 1024 # 200MB
141
+ ```
51
142
 
52
- ```ts
53
- //自定义中间件
54
- //默认会出传入 app: FastCarApplication 可供选择
55
- function Example(): koa.Middleware {
56
- return async (ctx: koa.Context, next: Function) => {
57
- console.log("example--- in");
58
- await next();
59
- console.log("example--- out");
143
+ ## 配置
144
+
145
+ ### KoaConfig 类型
146
+
147
+ ```typescript
148
+ type KoaConfig = {
149
+ // 服务器配置,支持多端口监听
150
+ server: ServerConfig | ServerConfig[];
151
+
152
+ // 静态文件路径映射 { 访问路径: 文件系统路径 }
153
+ koaStatic?: { [key: string]: string };
154
+
155
+ // koa-body 配置(文件上传)
156
+ koaBodyOptions?: { [key: string]: any };
157
+
158
+ // @koa/bodyparser 配置
159
+ koaBodyParser?: { [key: string]: any };
160
+
161
+ // 反向代理配置
162
+ koaProxy?: {
163
+ [path: string]: {
164
+ target: string;
165
+ changeOrigin?: boolean;
166
+ pathRewrite?: { [pattern: string]: string };
167
+ ws?: boolean;
60
168
  };
61
- }
169
+ };
170
+
171
+ // 其他扩展配置
172
+ extra?: { [key: string]: any };
173
+ };
174
+ ```
175
+
176
+ ## 装饰器/API 参考
177
+
178
+ ### 应用级装饰器
179
+
180
+ | 装饰器 | 用途 | 参数 |
181
+ |--------|------|------|
182
+ | `@EnableKoa` | 启用 Koa 组件 | 无 |
183
+ | `@KoaMiddleware(...middlewares)` | 注册中间件 | `...MiddleWareType[]` - 中间件函数数组,越靠前优先级越高 |
184
+
185
+ ### 路由装饰器
186
+
187
+ | 装饰器 | HTTP 方法 | 简写别名 | 参数 |
188
+ |--------|-----------|----------|------|
189
+ | `@GetMapping(path)` | GET | `@GET` | `string` - 路由路径 |
190
+ | `@PostMapping(path)` | POST | `@POST` | `string` - 路由路径 |
191
+ | `@PutMapping(path)` | PUT | `@PUT` | `string` - 路由路径 |
192
+ | `@DeleteMapping(path)` | DELETE | `@DELETE` | `string` - 路由路径 |
193
+ | `@PatchMapping(path)` | PATCH | `@PATCH` | `string` - 路由路径 |
194
+ | `@HeadMapping(path)` | HEAD | `@HEAD` | `string` - 路由路径 |
195
+ | `@AllMapping(path)` | ALL | `@ALL` | `string` - 路由路径 |
196
+ | `@RequestMapping(path)` | - | `@REQUEST` | `string` - 基础路径前缀 |
197
+
198
+ ### 控制器装饰器
199
+
200
+ | 装饰器 | 用途 |
201
+ |--------|------|
202
+ | `@Controller` | 标记类为控制器,自动扫描路由 |
203
+
204
+ ### 路由方法参数
205
+
206
+ 控制器方法的参数约定:
207
+
208
+ ```typescript
209
+ methodName(data: any, ctx: Context): any
210
+ ```
211
+
212
+ - `data`: 自动合并 `query` + `body` + `params` 的对象(重名时 body 优先级最高)
213
+ - `ctx`: Koa 的 Context 对象,可访问 `ctx.params`, `ctx.request.body`, `ctx.query` 等
214
+ - 返回值: 自动设置为 `ctx.body`
215
+
216
+ ## 内置中间件
217
+
218
+ ### 1. ExceptionGlobalHandler
219
+
220
+ 全局异常捕获,统一处理控制器抛出的错误。
221
+
222
+ ```typescript
223
+ import { ExceptionGlobalHandler } from "@fastcar/koa";
224
+
225
+ @KoaMiddleware(ExceptionGlobalHandler)
226
+ ```
227
+
228
+ ### 2. KoaBodyParser
229
+
230
+ 请求体解析(推荐),支持 JSON、表单等。
231
+
232
+ ```typescript
233
+ import { KoaBodyParser } from "@fastcar/koa";
234
+
235
+ @KoaMiddleware(KoaBodyParser)
236
+ // 配合配置
237
+ // koaBodyParser:
238
+ // jsonLimit: "1mb"
239
+ ```
240
+
241
+ ### 3. KoaBody
242
+
243
+ 文件上传解析(基于 koa-body)。
244
+
245
+ ```typescript
246
+ import { KoaBody } from "@fastcar/koa";
247
+
248
+ @KoaMiddleware(KoaBody)
249
+ // 配合配置
250
+ // koaBodyOptions:
251
+ // multipart: true
252
+ ```
253
+
254
+ ### 4. KoaCors
255
+
256
+ 跨域支持。
62
257
 
63
- //在主入口内添加
258
+ ```typescript
259
+ import { KoaCors } from "@fastcar/koa";
260
+
261
+ @KoaMiddleware(KoaCors)
262
+ ```
263
+
264
+ ### 5. KoaStatic
265
+
266
+ 静态文件服务(整合 koa-static + koa-range + koa-mount)。
267
+
268
+ ```typescript
269
+ import { KoaStatic } from "@fastcar/koa";
270
+
271
+ @KoaMiddleware(KoaStatic)
272
+ // 配合配置
273
+ // koaStatic:
274
+ // "/": "./resource/public"
275
+ // "/uploads": "./uploads"
276
+ ```
277
+
278
+ ### 6. KoaMulter
279
+
280
+ 增强的文件上传解析(基于 @koa/multer)。
281
+
282
+ ```typescript
283
+ import { KoaMulter } from "@fastcar/koa";
284
+
285
+ @KoaMiddleware(KoaMulter)
286
+ ```
287
+
288
+ ### 7. KoaProxy
289
+
290
+ 反向代理(基于 http-proxy-middleware)。
291
+
292
+ ```typescript
293
+ import { KoaProxy } from "@fastcar/koa";
294
+
295
+ @KoaMiddleware(KoaProxy)
296
+ // 配合配置
297
+ // koaProxy:
298
+ // "/api":
299
+ // target: "http://backend-server:8080"
300
+ // changeOrigin: true
301
+ ```
302
+
303
+ ### 8. Swagger
304
+
305
+ API 文档服务(需安装 swagger-ui-dist)。
306
+
307
+ ```typescript
308
+ import { Swagger } from "@fastcar/koa";
309
+
310
+ @KoaMiddleware(Swagger)
311
+ // 访问 /swagger 查看文档
312
+ ```
313
+
314
+ ### 9. HeaderCoding
315
+
316
+ Header 编码校验。
317
+
318
+ ```typescript
319
+ import { HeaderCoding } from "@fastcar/koa";
320
+
321
+ @KoaMiddleware(HeaderCoding)
322
+ ```
323
+
324
+ ## 示例
325
+
326
+ ### 自定义中间件
327
+
328
+ ```typescript
329
+ import * as Koa from "koa";
64
330
  import { FastCarApplication } from "@fastcar/core";
65
- import { Application } from "@fastcar/core/annotation";
66
- import { EnableKoa } from "@fastcar/koa/annotation";
331
+ import { KoaMiddleware } from "@fastcar/koa/annotation";
332
+
333
+ // 中间件工厂函数,接收 FastCarApplication 实例
334
+ function LoggerMiddleware(app: FastCarApplication): Koa.Middleware {
335
+ return async (ctx: Koa.Context, next: Function) => {
336
+ const start = Date.now();
337
+ console.log(`--> ${ctx.method} ${ctx.url}`);
338
+
339
+ await next();
340
+
341
+ const duration = Date.now() - start;
342
+ console.log(`<-- ${ctx.method} ${ctx.url} ${ctx.status} ${duration}ms`);
343
+ };
344
+ }
67
345
 
68
- @Application //注入基础框架
69
- @EnableKoa //开启koa
70
- @KoaMiddleware(Example)
71
- class APP {
72
- app!: FastCarApplication;
346
+ @Application
347
+ @EnableKoa
348
+ @KoaMiddleware(LoggerMiddleware, ExceptionGlobalHandler, KoaBodyParser)
349
+ class App {
350
+ app!: FastCarApplication;
73
351
  }
352
+ ```
353
+
354
+ ### 多 HTTP 方法绑定
355
+
356
+ ```typescript
357
+ import { Controller } from "@fastcar/core/annotation";
358
+ import { GetMapping, PostMapping } from "@fastcar/koa/annotation";
359
+
360
+ @Controller
361
+ export default class ResourceController {
362
+
363
+ // 同一个方法支持多种 HTTP 方法
364
+ @GetMapping("/resource")
365
+ @PostMapping("/resource")
366
+ handleResource(data: any) {
367
+ return { method: 'GET or POST', data };
368
+ }
369
+ }
370
+ ```
74
371
 
75
- export const app = new APP();
372
+ ### 文件上传
373
+
374
+ ```typescript
375
+ import { Controller } from "@fastcar/core/annotation";
376
+ import { POST } from "@fastcar/koa/annotation";
377
+ import { Context } from "koa";
378
+
379
+ @Controller
380
+ export default class UploadController {
381
+
382
+ @POST("/upload")
383
+ async uploadFile(data: any, ctx: Context) {
384
+ // 文件信息在 ctx.request.files 中
385
+ const files = ctx.request.files;
386
+ return {
387
+ code: 200,
388
+ message: "上传成功",
389
+ files: Object.keys(files || {})
390
+ };
391
+ }
392
+ }
76
393
  ```
77
394
 
78
- ## 默认整合的koa中间件(开启方式为@KoaMiddleware(XX))
395
+ ## 类型定义
79
396
 
80
- * ExceptionGlobalHandler 用于koa运行时的异常情况捕捉
81
- * KoaBody 用于文件上传 与 koa-body的用法一致
82
- * KoaBodyParser 用于请求数据的解析 推荐客户端使用application/json的方式
83
- * KoaCors 跨域设置(后期可能会用更好的插件替代)
84
- * KoaStatic 整合了koa-static,koa-range,koa-mount用于静态文件访问,可设置别名
85
- * Swagger 用于展示api文档使用(后期支持自动化配置说明)
397
+ ### 导出路径
86
398
 
87
- ## 注解说明
399
+ ```typescript
400
+ // 主模块
401
+ import { KoaApplication, KoaConfig } from "@fastcar/koa";
88
402
 
89
- * EnableKoa 作用于应用 开启Koa组件
403
+ // 装饰器
404
+ import { EnableKoa, KoaMiddleware, GET, POST, HEAD, ... } from "@fastcar/koa/annotation";
405
+ ```
90
406
 
91
- * AllMapping,ALL 作用于controller层 支持GET POST等请求方式访问
407
+ ### KoaApplication
92
408
 
93
- * GetMapping GET
409
+ ```typescript
410
+ class KoaApplication {
411
+ public koaApp: Koa; // Koa 实例
412
+
413
+ start(): void; // 启动服务
414
+ stop(): Promise<void>; // 停止服务
415
+ }
416
+ ```
94
417
 
95
- * PostMapping POST
418
+ ### 中间件类型
96
419
 
97
- * DeleteMapping DELETE
420
+ ```typescript
421
+ type MiddleWareType = (
422
+ app: FastCarApplication,
423
+ koaApp?: Koa
424
+ ) => Koa.Middleware | Koa.Middleware[] | Promise<Koa.Middleware | Koa.Middleware[]>;
425
+ ```
98
426
 
99
- * PatchMapping PATCH
427
+ ## 依赖关系
100
428
 
101
- * PutMapping PUT
429
+ ```
430
+ @fastcar/koa
431
+ ├── @fastcar/core (peer) - IoC 容器和组件生命周期
432
+ ├── @fastcar/server (peer) - HTTP 服务器管理
433
+ ├── koa (^3.1.1) - Web 框架
434
+ └── @koa/router (^15.1.1) - 路由
435
+ ```
102
436
 
103
- * RequestMapping REQUEST 作用于头部,用于追加url
437
+ ## 生命周期
104
438
 
105
- * KoaMiddleware 作用于应用 用于加载中间件 越在应用上面 优先级越高
439
+ 1. **启动阶段**(按优先级):
440
+ - 加载自定义中间件(按 `@KoaMiddleware` 声明顺序)
441
+ - 加载路由(扫描所有 `@Controller` 类)
442
+ - 启动 HTTP 服务监听
106
443
 
107
- ## 更多用法
444
+ 2. **停止阶段**:
445
+ - 延迟约 1 秒后关闭 server 连接
108
446
 
109
- 参考项目git地址 @fastcar/koa/test下的simple内
447
+ ## 许可证
110
448
 
111
- ## 项目开源地址
449
+ MIT License
112
450
 
113
- * 项目下载 git clone <https://github.com/williamDazhangyu/fast-car.git>
451
+ ---
114
452
 
115
- * 在线查看 <https://github.com/williamDazhangyu/fast-car>
453
+ **项目地址**: [https://github.com/williamDazhangyu/fast-car](https://github.com/williamDazhangyu/fast-car)
package/annotation.d.ts CHANGED
@@ -25,6 +25,8 @@ export function PatchMapping(url?: string): MRet;
25
25
 
26
26
  export function PutMapping(url?: string): MRet;
27
27
 
28
+ export function HeadMapping(url?: string): MRet;
29
+
28
30
  export function RequestMapping(url: string): Ret;
29
31
 
30
32
  export function ALL(url?: string): MRet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastcar/koa",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "homepage": "https://github.com/williamDazhangyu/fast-car",
5
5
  "description": "fastcar框架下对koa的包装",
6
6
  "main": "target/index.js",
@@ -0,0 +1,12 @@
1
+ import { RouteMethods } from "../../type/RouteMethods";
2
+ import AddMapping from "./AddMapping";
3
+
4
+ export default function HeadMapping(url?: string) {
5
+ return function (target: any, name: string, descriptor: PropertyDescriptor) {
6
+ AddMapping(target, {
7
+ url,
8
+ method: name,
9
+ request: [RouteMethods.HeadMapping],
10
+ });
11
+ };
12
+ }
package/src/annotation.ts CHANGED
@@ -5,6 +5,7 @@ import AddMapping from "./annotation/router/AddMapping";
5
5
  import AllMapping from "./annotation/router/AllMapping";
6
6
  import DeleteMapping from "./annotation/router/DeleteMapping";
7
7
  import GetMapping from "./annotation/router/GetMapping";
8
+ import HeadMapping from "./annotation/router/HeadMapping";
8
9
  import PatchMapping from "./annotation/router/PatchMapping";
9
10
  import PostMapping from "./annotation/router/PostMapping";
10
11
  import PutMapping from "./annotation/router/PutMapping";
@@ -18,6 +19,7 @@ const PUT = PutMapping;
18
19
  const PATCH = PatchMapping;
19
20
  const ALL = AllMapping;
20
21
  const REQUEST = RequestMapping;
22
+ const HEAD = HeadMapping;
21
23
 
22
24
  export {
23
25
  //关于请求方式注解
@@ -29,6 +31,7 @@ export {
29
31
  PostMapping,
30
32
  PutMapping,
31
33
  RequestMapping,
34
+ HeadMapping,
32
35
  //开启koa应用
33
36
  EnableKoa,
34
37
  //追加koa中间件
@@ -42,4 +45,5 @@ export {
42
45
  ALL,
43
46
  REQUEST,
44
47
  KoaApp,
48
+ HEAD,
45
49
  };
@@ -5,4 +5,5 @@ export enum RouteMethods {
5
5
  DeleteMapping = "delete",
6
6
  PatchMapping = "patch",
7
7
  AllMapping = "all",
8
+ HeadMapping = "head",
8
9
  }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = HeadMapping;
4
+ const RouteMethods_1 = require("../../type/RouteMethods");
5
+ const AddMapping_1 = require("./AddMapping");
6
+ function HeadMapping(url) {
7
+ return function (target, name, descriptor) {
8
+ (0, AddMapping_1.default)(target, {
9
+ url,
10
+ method: name,
11
+ request: [RouteMethods_1.RouteMethods.HeadMapping],
12
+ });
13
+ };
14
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KoaApp = exports.REQUEST = exports.ALL = exports.PATCH = exports.PUT = exports.DELETE = exports.POST = exports.GET = exports.KoaMiddleware = exports.EnableKoa = exports.RequestMapping = exports.PutMapping = exports.PostMapping = exports.PatchMapping = exports.GetMapping = exports.DeleteMapping = exports.AllMapping = exports.AddMapping = void 0;
3
+ exports.HEAD = exports.KoaApp = exports.REQUEST = exports.ALL = exports.PATCH = exports.PUT = exports.DELETE = exports.POST = exports.GET = exports.KoaMiddleware = exports.EnableKoa = exports.HeadMapping = exports.RequestMapping = exports.PutMapping = exports.PostMapping = exports.PatchMapping = exports.GetMapping = exports.DeleteMapping = exports.AllMapping = exports.AddMapping = void 0;
4
4
  const EnableKoa_1 = require("./annotation/EnableKoa");
5
5
  exports.EnableKoa = EnableKoa_1.default;
6
6
  const KoaApp_1 = require("./annotation/KoaApp");
@@ -15,6 +15,8 @@ const DeleteMapping_1 = require("./annotation/router/DeleteMapping");
15
15
  exports.DeleteMapping = DeleteMapping_1.default;
16
16
  const GetMapping_1 = require("./annotation/router/GetMapping");
17
17
  exports.GetMapping = GetMapping_1.default;
18
+ const HeadMapping_1 = require("./annotation/router/HeadMapping");
19
+ exports.HeadMapping = HeadMapping_1.default;
18
20
  const PatchMapping_1 = require("./annotation/router/PatchMapping");
19
21
  exports.PatchMapping = PatchMapping_1.default;
20
22
  const PostMapping_1 = require("./annotation/router/PostMapping");
@@ -38,3 +40,5 @@ const ALL = AllMapping_1.default;
38
40
  exports.ALL = ALL;
39
41
  const REQUEST = RequestMapping_1.default;
40
42
  exports.REQUEST = REQUEST;
43
+ const HEAD = HeadMapping_1.default;
44
+ exports.HEAD = HEAD;
@@ -9,4 +9,5 @@ var RouteMethods;
9
9
  RouteMethods["DeleteMapping"] = "delete";
10
10
  RouteMethods["PatchMapping"] = "patch";
11
11
  RouteMethods["AllMapping"] = "all";
12
+ RouteMethods["HeadMapping"] = "head";
12
13
  })(RouteMethods || (exports.RouteMethods = RouteMethods = {}));