Customising the default webserver
Without changing anything in q you can make a kdb+ session serve up static content by creating a directory called
html underneath your
QHOME directory. This is the root server for the webserver (like the Apache
/var/www/html) and is the place to save static content to be served up from kdb+. Try for example saving a
favicon.ico file there and calling up a page.
The default location can be changed by setting the variable
Every HTTP request that comes into a q session is handled by .z.ph. By default it simply wraps the output from showing the data requested inside a fixed width tag (
xmp) and sends it back. This is fast and simple, and will work in all browsers – even Internet Explorer – but makes it very difficult to apply any CSS styling to the data.
If you’re prepared to make changes, the sample code in
simongarland/doth shows how to modify the
doth.k file in your
QHOME, and the two
plaid.* files in your
QHOME/html directory – create it if necessary - then