kore/examples/cpp
Joris Vink e98a4ddab5 Change how routes are configured in Kore.
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.
2021-09-15 11:09:52 +02:00
..
conf Change how routes are configured in Kore. 2021-09-15 11:09:52 +02:00
src Style changes. 2015-04-07 13:11:31 +02:00
.gitignore Add C++ example. 2015-04-01 07:59:32 -04:00
README.md kore -> kodev where appropriate 2017-03-06 11:00:53 +01:00

README.md

Kore example showing how to use C++ support!

All functions accessible to kore must have their prototypes wrapped with the extern keyword like so:

extern “C” {
	int pageA(struct http_request *);
	int pageB(struct http_request *);
	int validatorA(struct http_request *, char *);
}

In order to run this example with the default C++ settings (default compiler dialect, libstdc++):

	# kodev run

In order to run with a specific dialect and C++ runtime:

	# env CXXSTD=c++11 CXXLIB=c++ kodev run

You can also supply your own compiler combined with the above:

	# env CC=clang++ CXXSTD=c++11 CXXLIB=c++ kodev run