liquid_feedback_frontend
changeset 732:3a61d21618f6
Made database configurable
author | bsw |
---|---|
date | Thu Jun 28 17:23:38 2012 +0200 (2012-06-28) |
parents | 0015fa6eb637 |
children | 9c88e513a8f7 |
files | config/default.lua config/init.lua |
line diff
1.1 --- a/config/default.lua Thu Jun 28 17:21:16 2012 +0200 1.2 +++ b/config/default.lua Thu Jun 28 17:23:38 2012 +0200 1.3 @@ -26,8 +26,13 @@ 1.4 1.5 -- ======================================================================== 1.6 -- Optional config options 1.7 +-- Remove leading -- to enable a option 1.8 -- ======================================================================== 1.9 1.10 +-- Connection information for the LiquidFeedback database 1.11 +-- ------------------------------------------------------------------------ 1.12 +-- config.database = { engine='postgresql', dbname='liquid_feedback' } 1.13 + 1.14 -- Absolute base url of application 1.15 -- ------------------------------------------------------------------------ 1.16 -- config.absolute_base_url = "http://example.com/"
2.1 --- a/config/init.lua Thu Jun 28 17:21:16 2012 +0200 2.2 +++ b/config/init.lua Thu Jun 28 17:23:38 2012 +0200 2.3 @@ -39,13 +39,14 @@ 2.4 } 2.5 end 2.6 2.7 +if not config.database then 2.8 + config.database = { engine='postgresql', dbname='liquid_feedback' } 2.9 +end 2.10 + 2.11 request.set_404_route{ module = 'index', view = '404' } 2.12 2.13 -- open and set default database handle 2.14 -db = assert(mondelefant.connect{ 2.15 - engine='postgresql', 2.16 - dbname='liquid_feedback' 2.17 -}) 2.18 +db = assert(mondelefant.connect(config.database) 2.19 at_exit(function() 2.20 db:close() 2.21 end)