kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 261fb3c3fa8f9b919d1c87e946a3d12ce96ab838
parent 3d8e0dabc079f5cd74dd6c6235fcc1f39f02a96c
Author: Joris Vink <joris@coders.se>
Date:   Wed,  1 Feb 2017 17:15:18 +0100

flesh out python example a bit more.

Diffstat:
examples/python/src/index.py | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/examples/python/src/index.py b/examples/python/src/index.py @@ -46,14 +46,18 @@ def python_validator(req, data): # The action param is kore.MODULE_LOAD or kore.MODULE_UNLOAD respectively. # def onload(action): - kore.log(kore.LOG_INFO, "FOOBAR python onload called with %d" % action) + kore.log(kore.LOG_INFO, "python module onload called with %d!" % action) return kore.RESULT_OK -def kore_onload(): - print("kore_onload called") +# Called by Kore when the parent is starting. +def kore_parent_configure(): + # Listen on an additional interface and port. + kore.listen("127.0.0.1", "8889", "") + kore.log(kore.LOG_INFO, "kore_parent_configure called!") -def kore_preload(): - print("kore_preload called") +# Called by Kore when the worker is starting. +def kore_worker_configure(): + kore.log(kore.LOG_INFO, "kore_worker_configure called!") # # Test page handler that displays some debug information as well as