jbe/bsw@0: -- uncomment the following two lines to use C implementations of chosen jbe/bsw@0: -- functions and to disable garbage collection during the request, to jbe/bsw@0: -- increase speed: jbe/bsw@0: -- jbe/bsw@0: -- require 'webmcp_accelerator' jbe/bsw@0: -- collectgarbage("stop") jbe/bsw@0: jbe/bsw@0: -- open and set default database handle jbe@254: config.db = { jbe/bsw@0: engine='postgresql', jbe/bsw@0: dbname='webmcp_demo' jbe@254: } jbe/bsw@0: jbe@254: listen{ jbe@254: { proto = "tcp4", port = 8080 }, jbe@316: { proto = "tcp6", port = 8080 }, jbe@316: { proto = "interval", delay = 60, handler = function() io.stderr:write("Background job executed here\n") end } jbe@254: } jbe@254: jbe@254: --[[ jbe/bsw@0: -- enable output of SQL commands in trace system jbe/bsw@0: function db:sql_tracer(command) jbe/bsw@0: return function(error_info) jbe/bsw@0: local error_info = error_info or {} jbe/bsw@0: trace.sql{ command = command, error_position = error_info.position } jbe/bsw@0: end jbe/bsw@0: end jbe@254: --]] jbe/bsw@0: jbe/bsw@0: -- 'request.get_relative_baseurl()' should be replaced by the absolute jbe/bsw@0: -- base URL of the application, as otherwise HTTP redirects will not be jbe/bsw@0: -- standard compliant jbe@254: --request.set_absolute_baseurl(request.get_relative_baseurl()) jbe/bsw@0: jbe/bsw@0: -- uncomment the following lines, if you want to use a database driven jbe/bsw@0: -- tempstore (for flash messages): jbe/bsw@0: -- jbe/bsw@0: -- function tempstore.save(blob) jbe/bsw@0: -- return Tempstore:create(blob) jbe/bsw@0: -- end jbe/bsw@0: -- function tempstore.pop(key) jbe/bsw@0: -- return Tempstore:data_by_key(key) jbe/bsw@0: -- end jbe/bsw@0: jbe/bsw@0: