webmcp
diff demo-app/config/demo.lua @ 254:2169a62e12f5
Work on demo application (to fit modified WebMCP API); Bugfixes of WebMCP
author | jbe |
---|---|
date | Mon Mar 02 01:15:34 2015 +0100 (2015-03-02) |
parents | 72860d232f32 |
children | a2c733535b8e |
line diff
1.1 --- a/demo-app/config/demo.lua Sun Mar 01 22:56:06 2015 +0100 1.2 +++ b/demo-app/config/demo.lua Mon Mar 02 01:15:34 2015 +0100 1.3 @@ -6,15 +6,17 @@ 1.4 -- collectgarbage("stop") 1.5 1.6 -- open and set default database handle 1.7 -db = assert(mondelefant.connect{ 1.8 +config.db = { 1.9 engine='postgresql', 1.10 dbname='webmcp_demo' 1.11 -}) 1.12 -at_exit(function() 1.13 - db:close() 1.14 -end) 1.15 -function mondelefant.class_prototype:get_db_conn() return db end 1.16 +} 1.17 1.18 +listen{ 1.19 + { proto = "tcp4", port = 8080 }, 1.20 + { proto = "tcp6", port = 8080 } 1.21 +} 1.22 + 1.23 +--[[ 1.24 -- enable output of SQL commands in trace system 1.25 function db:sql_tracer(command) 1.26 return function(error_info) 1.27 @@ -22,11 +24,12 @@ 1.28 trace.sql{ command = command, error_position = error_info.position } 1.29 end 1.30 end 1.31 +--]] 1.32 1.33 -- 'request.get_relative_baseurl()' should be replaced by the absolute 1.34 -- base URL of the application, as otherwise HTTP redirects will not be 1.35 -- standard compliant 1.36 -request.set_absolute_baseurl(request.get_relative_baseurl()) 1.37 +--request.set_absolute_baseurl(request.get_relative_baseurl()) 1.38 1.39 -- uncomment the following lines, if you want to use a database driven 1.40 -- tempstore (for flash messages): 1.41 @@ -39,10 +42,3 @@ 1.42 -- end 1.43 1.44 1.45 -function mondelefant.class_prototype:by_id(id) 1.46 - return self:new_selector() 1.47 - :add_where{ "id = ?", id } 1.48 - :optional_object_mode() 1.49 - :exec() 1.50 -end 1.51 -