mirror of https://github.com/Seich/Beau.git
20 lines
421 B
JavaScript
20 lines
421 B
JavaScript
class Modifiers {
|
|
constructor(registry, settings = {}) {
|
|
registry.addPreRequestModifier(this.preRequest);
|
|
registry.addPostRequestModifier(this.postRequest);
|
|
}
|
|
|
|
preRequest(request, orig) {
|
|
request.headers.preRequestModifier = true;
|
|
return request;
|
|
}
|
|
|
|
postRequest(response, orig) {
|
|
response.body = 'Hello World';
|
|
response.response.body = 'Hello World';
|
|
return response;
|
|
}
|
|
}
|
|
|
|
module.exports = Modifiers;
|