@bigtest/mirage
Version:
A client-side server to develop, test and prototype your app.
17 lines (14 loc) • 370 B
JavaScript
export default class Response {
constructor(code, headers = {}, data = {}) {
this.code = code;
this.headers = headers;
this.data = data;
}
toRackResponse() {
let { headers } = this;
if (!headers.hasOwnProperty('Content-Type')) {
headers['Content-Type'] = 'application/json';
}
return [this.code, this.headers, this.data];
}
}