Upload main code

This commit is contained in:
2019-01-12 15:17:13 +01:00
committed by GitHub
parent 84507a8d6b
commit a03320593f
7 changed files with 247 additions and 2 deletions

14
model/WumpResponse.js Normal file
View File

@@ -0,0 +1,14 @@
module.exports = class WumpResponse {
constructor ( res ) {
this.body = Buffer.alloc( 0 );
this.coreRes = res
this.headers = res.headers;
this.statusCode = res.statusCode;
}
_addChunk ( chunk ) { this.body = Buffer.concat([ this.body, chunk ]); }
text () { return this.body.toString(); }
json () { return JSON.parse( this.body ); }
}