Go to file
kingecg 9ac9deaa8f add design 2023-03-01 21:50:09 +08:00
model add design 2023-03-01 21:50:09 +08:00
.gitignore Initial commit 2023-03-01 21:06:59 +08:00
LICENSE Initial commit 2023-03-01 21:06:59 +08:00
README.md add design 2023-03-01 21:50:09 +08:00
package.json add design 2023-03-01 21:50:09 +08:00

README.md

http-gateway

a lib for create gateway between and other protocol

interface

  • create 创建http服务器app
  • registryHandlerFactory 注册protocol处理器工厂
  • app.registryPath

HandlerFactory

一个函数或者拥有静态createHandler方法的class

工厂函数/createHandler方法签名

interface HandlerFn {
    (options: any): (req:Request,resp: Response)=>void
}

interface HandlerClass {
    createHandler: HandlerFn
}

type HandlerFactory = HandlerFn | HandlerClass

registryHandlerFactory

registryHandlerFactory(type:string, HandlerFactory)