Skip to content

Instantly share code, notes, and snippets.

@bmeck
Forked from Marak/echoHttpRequest.js
Last active August 29, 2015 14:08

Revisions

  1. bmeck revised this gist Oct 29, 2014. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,8 @@ module['exports'] = function echoHttp (hook) {

    hook.debug(hook.req.method);

    hook.res.end(JSON.stringify(hook.params, true, 2));
    hook.req.pipe(hook.res);

    };
    };

    module['exports'].streaming = true;
  2. @Marak Marak created this gist Oct 29, 2014.
    11 changes: 11 additions & 0 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    module['exports'] = function echoHttp (hook) {

    hook.debug(hook.params);

    hook.debug(hook.req.path);

    hook.debug(hook.req.method);

    hook.res.end(JSON.stringify(hook.params, true, 2));

    };