Skip to content

Instantly share code, notes, and snippets.

@myszek123
Forked from Marak/echoHttpRequest.js
Last active September 16, 2015 14:26
Show Gist options
  • Select an option

  • Save myszek123/1ebabd34345fba4ab35e to your computer and use it in GitHub Desktop.

Select an option

Save myszek123/1ebabd34345fba4ab35e to your computer and use it in GitHub Desktop.

Revisions

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

    console.log("Console messages are sent to /logs");

    hook.debug(hook.params);
    console.log(hook.params);

    hook.debug(hook.req.path);
    console.log(hook.req.path);

    hook.debug(hook.req.method);
    console.log(hook.req.method);

    hook.debug(hook.env);
    console.log(hook.env);

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

  2. @Marak Marak revised this gist Jul 27, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    module['exports'] = function echoHttp (hook) {

    hook.debug("Debug messages are sent to the debug console");
    console.log("Console messages are sent to /logs");

    hook.debug(hook.params);

  3. @Marak Marak revised this gist Jul 16, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,6 @@ module['exports'].schema = {
    },
    "param2": {
    "type": "string",
    "value": "bar"
    "default": "bar"
    }
    };
  4. @Marak Marak revised this gist Jul 16, 2015. 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
    @@ -19,9 +19,11 @@ module['exports'] = function echoHttp (hook) {
    // For Example: curl http://echo.hook.io?foo=bar
    module['exports'].schema = {
    "param1": {
    "type": "string"
    "type": "string",
    "default": "foo"
    },
    "param2": {
    "type": "string"
    "type": "string",
    "value": "bar"
    }
    };
  5. @Marak Marak revised this gist Jul 15, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,9 @@ module['exports'] = function echoHttp (hook) {

    };

    // Remark: Using a schema is *completely* optional!
    // You *can* pass abritrary parameters without using a schema
    // For Example: curl http://echo.hook.io?foo=bar
    module['exports'].schema = {
    "param1": {
    "type": "string"
  6. @Marak Marak revised this gist Nov 12, 2014. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -22,9 +22,3 @@ module['exports'].schema = {
    "type": "string"
    }
    };


    // The Theme and Presenter will default to the following files if not set
    // see: http://hook.io/themes
    module['exports'].theme = "http://hook.io/themes/debug/index.html";
    module['exports'].presenter = "http://hook.io/themes/debug/index.js";
  7. @Marak Marak revised this gist Nov 12, 2014. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,10 @@ module['exports'].schema = {
    "param2": {
    "type": "string"
    }
    };
    };


    // The Theme and Presenter will default to the following files if not set
    // see: http://hook.io/themes
    module['exports'].theme = "http://hook.io/themes/debug/index.html";
    module['exports'].presenter = "http://hook.io/themes/debug/index.js";
  8. @Marak Marak revised this gist Nov 12, 2014. 1 changed file with 1 addition and 6 deletions.
    7 changes: 1 addition & 6 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -21,9 +21,4 @@ module['exports'].schema = {
    "param2": {
    "type": "string"
    }
    };

    // The Theme and Presenter will default to the following files if not set
    // see: http://hook.io/themes
    module['exports'].theme = "http://hook.io/themes/debug/index.html";
    module['exports'].presenter = "http://hook.io/themes/debug/index.js";
    };
  9. @Marak Marak revised this gist Nov 10, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -25,5 +25,5 @@ module['exports'].schema = {

    // The Theme and Presenter will default to the following files if not set
    // see: http://hook.io/themes
    //module['exports'].theme = "http://hook.io/themes/debug/index.html";
    //module['exports'].presenter = "http://hook.io/themes/debug/index.js";
    module['exports'].theme = "http://hook.io/themes/debug/index.html";
    module['exports'].presenter = "http://hook.io/themes/debug/index.js";
  10. @Marak Marak revised this gist Nov 10, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -25,5 +25,5 @@ module['exports'].schema = {

    // The Theme and Presenter will default to the following files if not set
    // see: http://hook.io/themes
    module['exports'].theme = "http://hook.io/themes/debug/index.html";
    module['exports'].presenter = "http://hook.io/themes/debug/index.js";
    //module['exports'].theme = "http://hook.io/themes/debug/index.html";
    //module['exports'].presenter = "http://hook.io/themes/debug/index.js";
  11. @Marak Marak revised this gist Nov 8, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ module['exports'].schema = {
    }
    };

    // The Theme and Presenter will default to the following follows if not set
    // The Theme and Presenter will default to the following files if not set
    // see: http://hook.io/themes
    module['exports'].theme = "http://hook.io/themes/debug/index.html";
    module['exports'].presenter = "http://hook.io/themes/debug/index.js";
  12. @Marak Marak revised this gist Nov 7, 2014. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,9 @@ module['exports'].schema = {
    "param2": {
    "type": "string"
    }
    };
    };

    // The Theme and Presenter will default to the following follows if not set
    // see: http://hook.io/themes
    module['exports'].theme = "http://hook.io/themes/debug/index.html";
    module['exports'].presenter = "http://hook.io/themes/debug/index.js";
  13. @Marak Marak revised this gist Nov 5, 2014. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,13 @@ module['exports'] = function echoHttp (hook) {

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

    };

    module['exports'].schema = {
    "param1": {
    "type": "string"
    },
    "param2": {
    "type": "string"
    }
    };
  14. @Marak Marak revised this gist Oct 31, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions echoHttpRequest.js
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,8 @@ module['exports'] = function echoHttp (hook) {
    hook.debug(hook.req.path);

    hook.debug(hook.req.method);

    hook.debug(hook.env);

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

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

    hook.debug('Debug messages are sent to the debug console.');
    hook.debug("Debug messages are sent to the debug console");

    hook.debug(hook.params);

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

    hook.debug(hook.params);

    //hook.debug(hook.req.path);
    hook.debug(hook.req.path);

    //hook.debug(hook.req.method);
    hook.debug(hook.req.method);

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

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

    hook.debug(hook.params);

    hook.debug(hook.req.path);
    //hook.debug(hook.req.path);

    hook.debug(hook.req.method);
    //hook.debug(hook.req.method);

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

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

    hook.debug('Debug messages are sent to the debug console.');

    hook.debug(hook.params);

    hook.debug(hook.req.path);
  19. @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));

    };