kapow! tidy server example

This commit is contained in:
César Gallego Rodríguez
2020-02-24 14:56:21 +01:00
parent 7d208d6318
commit 42329a6f56
@@ -71,3 +71,28 @@ If you need to write more complex actions, you can leverage multiline commands:
<https://en.wikipedia.org/wiki/Here_document>`_
Keep things tidy
----------------
Sometimes things grow, and keep things tidy it's the only way to mantain the
hole thing.
You can distribute your endpoints among several pow files. And you can keep the
hole thing documented in one html server with kapow.
.. code-block:: console
:linenos:
$ cat index.pow
#!/bin/bash
kapow route add / - <<-'EOF'
cat howto.html | kapow set /response/body
EOF
source ./info_stuff.pow
source ./other_endpoints.pow
As you can see the pow files can be imported into another pow files using
source. In fat a pow file it's a regular shell file.