UNPKG

@incdevco/framework

Version:
40 lines (24 loc) 752 B
'use strict'; var Qs = require('qs'); class Request { constructor(config) { this.body = config.body || ''; this.cognito = config.cognito; this.headers = config.headers || {}; this.method = config.method; this.params = config.params; this.path = config.path; this.query = config.query; this.querystring = config.querystring; if (!this.query && this.querystring) { if (typeof this.querystring === 'string') { this.query = Qs.parse(this.querystring); } else { this.query = this.querystring; } } console.log('Request', 'this', JSON.stringify(this, null, 2)); } } module.exports = Request;