kingecg 9ac9deaa8f | ||
---|---|---|
model | ||
.gitignore | ||
LICENSE | ||
README.md | ||
package.json |
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)