handler(method: string, path: string, req: Http2ServerRequest, res: Http2ServerResponse, d: object, callback: (val: any, d: object, cb: () => {}, req: Http2ServerRequest, res: Http2ServerResponse) => {}): Promise<object> {
// hanlder
return new Promise((resolve, reject) => {
let data = Buffer;
req.on('error', (err) => {
reject(err)
}).on('data', (chunk) => {
data.push(chunk);
}).on('end', () => {
resolve({
req: req,
res: res,
data: data,
maincb: callback,
cb: this.method,
maindata: d
});
})
})
};
没啥好说,记录一下过程