webmcp
view demo-app/config/demo.lua @ 262:c3d539e33710
Replaced request.add_initializer(...) and request.add_variable(...) with request.for_each(...) and request.configure(...) which both execute the passed function once in any case when being called
| author | jbe | 
|---|---|
| date | Tue Mar 17 11:42:34 2015 +0100 (2015-03-17) | 
| parents | 2169a62e12f5 | 
| children | a2c733535b8e | 
 line source
     1 -- uncomment the following two lines to use C implementations of chosen
     2 -- functions and to disable garbage collection during the request, to
     3 -- increase speed:
     4 --
     5 -- require 'webmcp_accelerator'
     6 -- collectgarbage("stop")
     8 -- open and set default database handle
     9 config.db = {
    10   engine='postgresql',
    11   dbname='webmcp_demo'
    12 }
    14 listen{
    15   { proto = "tcp4", port = 8080 },
    16   { proto = "tcp6", port = 8080 }
    17 }
    19 --[[
    20 -- enable output of SQL commands in trace system
    21 function db:sql_tracer(command)
    22   return function(error_info)
    23     local error_info = error_info or {}
    24     trace.sql{ command = command, error_position = error_info.position }
    25   end
    26 end
    27 --]]
    29 -- 'request.get_relative_baseurl()' should be replaced by the absolute
    30 -- base URL of the application, as otherwise HTTP redirects will not be
    31 -- standard compliant
    32 --request.set_absolute_baseurl(request.get_relative_baseurl())
    34 -- uncomment the following lines, if you want to use a database driven
    35 -- tempstore (for flash messages):
    36 --
    37 -- function tempstore.save(blob)
    38 --   return Tempstore:create(blob)
    39 -- end
    40 -- function tempstore.pop(key)
    41 --   return Tempstore:data_by_key(key)
    42 -- end
