Merge branch 'master' of ssh://github.com/BBVA/kapow
This commit is contained in:
@@ -21,7 +21,7 @@ Overview
|
||||
/
|
||||
│
|
||||
├─ request
|
||||
│ ├──── method Used HTTP Method (GET, POST)
|
||||
│ ├──── method HTTP Method used (GET, POST)
|
||||
│ ├──── host Host part of the URL
|
||||
│ ├──── path Complete URL path (URL-unquoted)
|
||||
│ ├──── matches
|
||||
|
||||
@@ -84,8 +84,6 @@ whole thing documented in one html file, served with *Kapow!*.
|
||||
:linenos:
|
||||
|
||||
$ cat index.pow
|
||||
#!/usr/bin/env bash
|
||||
|
||||
kapow route add / - <<-'EOF'
|
||||
cat howto.html | kapow set /response/body
|
||||
EOF
|
||||
@@ -99,22 +97,19 @@ source. In fact, a `pow` file is just a regular shell script.
|
||||
Debugging scripts
|
||||
-----------------
|
||||
|
||||
Kapow! redirect standard output and standard error of the pow file given on server
|
||||
startup to its own standard output and error, so you can use ``set -x`` at the beginning
|
||||
of the script in order to be able to see all the commands expanded and usethat information
|
||||
for debugging.
|
||||
Since *Kapow!* redirects the standard output and the standard error of the `pow`
|
||||
file given on server startup to its own, you can leverage ``set -x`` to see the
|
||||
commands that are being executed, and use that for debugging.
|
||||
|
||||
In order to be able to debug user request executions, the server subcommand has
|
||||
a ``--debug`` option flag that redirects the script standard output and standard error
|
||||
to Kapow! standard output, so you can use ``set -x`` at the beginning of the script
|
||||
the same way as in pow files.
|
||||
To support debugging user request executions, the server subcommand has a
|
||||
``--debug`` option flag that prompts *Kapow!* to redirect both the script's
|
||||
standard output and standard error to *Kapow!*'s standard output, so you can
|
||||
leverage ``set -x`` the same way as with `pow` files.
|
||||
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ cat withdebug.pow
|
||||
#!/usr/bin/env bash
|
||||
|
||||
kapow route add / - <<-'EOF'
|
||||
set -x
|
||||
echo "This will be seen in the log"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Welcome to *Kapow!*
|
||||
===================
|
||||
|
||||
.. image:: https://circleci.com/gh/BBVA/kapow/tree/master.svg?style=svg
|
||||
:target: https://circleci.com/gh/BBVA/kapow/tree/master
|
||||
.. image:: https://github.com/BBVA/kapow/workflows/Test/badge.svg
|
||||
:target: https://github.com/BBVA/kapow/actions?query=workflow%3ATest
|
||||
.. image:: https://goreportcard.com/badge/github.com/bbva/kapow
|
||||
:target: https://goreportcard.com/report/github.com/bbva/kapow
|
||||
.. image:: https://img.shields.io/github/issues/BBVA/kapow
|
||||
|
||||
@@ -21,9 +21,8 @@ What have we done?
|
||||
|
||||
**Junior**
|
||||
|
||||
Got it! There're a
|
||||
`lot of resources to work with </theory/resource_tree.rst>`_, I see that we
|
||||
can write to the response. Do you think this will work for us?
|
||||
Got it! There're a :ref:`lot of resources to work with <resource-tree>`.
|
||||
I see that we can write to the response. Do you think this will work for us?
|
||||
|
||||
**Senior**
|
||||
|
||||
@@ -47,7 +46,7 @@ What have we done?
|
||||
**Senior**
|
||||
|
||||
Looks good to me, clean and simple, and it is a very good idea to use ``GET``
|
||||
here as it wont change anything in the server. Let's restart *Kapow!* and try it.
|
||||
here as it won't change anything in the server. Let's restart *Kapow!* and try it.
|
||||
|
||||
**Junior**
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ I Need my Report!
|
||||
|
||||
**Junior**
|
||||
|
||||
And why *Susan* can't ``ssh`` into the server herself to see all of this?
|
||||
And why can't *Susan* ``ssh`` into the server herself to see all of this?
|
||||
|
||||
**Senior**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user