mirror of
https://git.kore.io/kore.git
synced 2025-01-04 23:45:16 +01:00
e98a4ddab5
Routes are now configured in a context per route: route /path { handler handler_name methods get post head validate qs:get id v_id } All route related configurations are per-route, allowing multiple routes for the same path (for different methods). The param context is removed and merged into the route context now so that you use the validate keyword to specify what needs validating. |
||
---|---|---|
.. | ||
assets | ||
conf | ||
src | ||
.gitignore | ||
README.md |
Kore example of tasks and websockets.
This example connects Kore via task to a named unix pipe and spews out any output to all connected websocket clients.
Before you run this make the pipe: $ mkfifo /tmp/pipe
Run:
$ kodev run
Test:
Open a browser that does websockets, surf to https://127.0.0.1:8888
or whatever configured IP you have in the config.
Hit the connect button to open a websocket session.
Now connect a writer endpoint to the named pipe (/tmp/pipe):
$ echo "hello" > /tmp/pipe
You should see the result in your browser.