Sorry, forgot to attach the diff.

--
Fabio Mascarenhas


On Mon, Jan 25, 2010 at 7:44 PM, Fabio Mascarenhas <mascaren...@acm.org> wrote:
> No way to do that with the current version of Xavante, sorry...
>
> But if you apply the attached diff to wsapi/xavante.lua you will be
> able to pass a hash of extra variables to
> makeHandler/makeGenericHandler.
>
> --
> Fabio Mascarenhas
>
>
> On Mon, Jan 25, 2010 at 2:19 PM, Alexander Gladysh <aglad...@gmail.com> wrote:
>> Sorry to nag, but -- any comments on the issue?
>>
>> Alexander.
>>
>> On Fri, Jan 22, 2010 at 19:49, Alexander Gladysh <aglad...@gmail.com> wrote:
>>> Hi, list!
>>>
>>> I need to pass two extra config variables to my wsapi handlers. In
>>> nginx I'm doing this in config:
>>>
>>>    fastcgi_param  MY_CONFIG_HOST "127.0.0.1";
>>>    fastcgi_param  MY_CONFIG_PORT "42";
>>>
>>> But to do black-box HTTP request testing, I'm using Xavante to spawn
>>> wsapi in my test code (xavante is spawned right from the testing
>>> framework). What is the way to pass these variables using
>>> wsapi.xavante?
>>>
>>> Here is how I do this now (my setup does not need a docroot, loader
>>> returns my wsapi run() function, this code is run in a fork by testing
>>> framework):
>>>
>>>      -- TODO: UBERHACK!
>>>      local FAKE_DOCROOT = tserialize(
>>>          {
>>>            MY_CONFIG_HOST = config_host;
>>>            MY_CONFIG_PORT = config_port;
>>>          }
>>>        )
>>>
>>>      local rules =
>>>      {
>>>        {
>>>          match = { ".*" };
>>>          with = wsapi.xavante.makeHandler(loader(), "/", FAKE_DOCROOT, "")
>>>        }
>>>      }
>>>
>>>      xavante.HTTP
>>>      {
>>>        server = { host = host; port = port };
>>>
>>>        defaultHost =
>>>        {
>>>          rules = rules;
>>>        };
>>>      }
>>>
>>>      xavante.start()
>>>
>>> I really hate this workaround. Is there a better way?
>>>
>>> Alexander.
>>>
>>
>> _______________________________________________
>> Kepler-Project mailing list
>> Kepler-Project@lists.luaforge.net
>> http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
>> http://www.keplerproject.org/
>>
>

Attachment: extra_vars.diff
Description: Binary data

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to