Mod_okioki is a project mainly written in C and SHELL, based on the GPL-3.0 license.
An apache module that offers a RESTful data service with a PostgresQL server.
Okioki is a Maori word, meaning: to rest.
There is a lot of infrastructure build for webservices, such as load balances, caching/proxy servers, compression, encryption, authentication, auhtorization and logging. By having this Okioki module between the application server and its database as a shim will give you access to all this infrastructure. Okioki was designed to make it really easy to make such a RESTful data service.
Design constraints for this module are:
A webservice is identified by the http method and url. In Okioki the url is defined with an extended regular expression, with optional groups.
Each of the webservices has an SQL statement associated with it. Parameters used by the SQL statement can be gotten from the http client in several ways.
The result of the SQL statement is written to the http client in a CSV (comman seperated values). The result may also be written to a cookie (only the value from the first row of the result).
It is recommended to create stored procedures for the more complicated services.
Below is part of an apache configuration file. The first part loads the module.
<IfModule !mod_okioki.c> LoadModule okioki_module modules/mod_okioki.so
<VirtualHost *:80> DBDriver pgsql DBDParams "host=localhost dbname=tautoru user=tautoru password=xxxxxx"
DBDPrepareSQL "select id, name from otp_algorithm;" sql_test
DBDPrepareSQL "select name from otp_algorithm where id = %hhd;" sql_test_id
#RewriteLog "/var/log/apache2/rewrite.log"
#RewriteLogLevel 9
RewriteEngine on
RewriteRule ^/tautoru/test/(.*) /tautoru/test_id?id=$1
<Location /tautoru>
SetHandler okioki-handler
OkiokiCommand GET /test CSV sql_test
OkiokiCommand GET /test_id CSV sql_test_id id
</Location>