kore/include/kore
Joris Vink fb335e1e0c Major Python API improvements.
1) Add @kore.route as a decorator for Python.

This decorator can be used on non-class methods to automatically
declare their route and parameters.

Takes the same arguments as the kore.domain.route function that
exists today.

Provides a nice clean way of setting up Kore if you dont want
a whole class based approach.

2) Remove the requirement for the name for kore.server() and the
kore.domain(attach=) keywords.

Instead of no name was given, the name "default" is used in both
places resulting in less boilerplating.

3) Allow multiple routes to be defined for the same URI as long
as the methods are different. So you can have one method for GET /
and another for POST /.

All changes combined condense the initial experience of getting
a Kore Python app up and running:

eg:

import kore

kore.server(ip="127.0.0.1", port="8888", tls=False)
kore.domain("*")

@kore.route("/", methods=["get"])
async def index(req):
    req.response(200, b'get method')

@kore.route("/", methods=["post"])
async def index_post(req)
    req.response(200, b'post method')
2021-05-02 00:32:47 +02:00
..
acme.h bump copyright year. 2021-01-11 23:46:08 +01:00
curl.h bump copyright year. 2021-01-11 23:46:08 +01:00
hooks.h Move Kore hook functions to kore/hooks.h. 2021-01-11 23:58:26 +01:00
http.h Add the http_pretty_error configuration option. 2020-03-04 08:22:51 +01:00
jsonrpc.h Move header files to include/kore. 2018-03-30 13:45:29 +02:00
kore.h Major Python API improvements. 2021-05-02 00:32:47 +02:00
pgsql.h bump copyright year. 2021-01-11 23:46:08 +01:00
python_api.h Major Python API improvements. 2021-05-02 00:32:47 +02:00
python_methods.h Major Python API improvements. 2021-05-02 00:32:47 +02:00
seccomp.h KORE_SECCOMP_FILTER() does not require a semicolumn. 2021-03-23 15:03:47 +01:00
tasks.h Changes to the event loop inside of Kore. 2018-10-09 19:34:40 +02:00