incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Weber <scotty2...@sbcglobal.net>
Subject Re: Handle the Welcome Request
Date Mon, 14 Apr 2014 03:45:21 GMT
Thanks, but that's not a lot to go on...

I tried copying the handler from _utils:

/ = {couch_httpd_misc_handlers, handle_utils_dir_req, "/me/there/page.html"}
I got:

{"error":"unknown_error","reason":"function_clause"}

I tried:

/ = {couch_httpd_misc_handlers, handle_welcome_req, "/me/there/page.html"}
and 

/ = {couch_httpd_misc_handlers, handle_welcome_req, "../me/there/page.html"}
Same result.

By the way, the redirection is to a database/document/attachment, not a generic file on the
disk (specifically a login for the app)

The log is 130 lines of error, not like the last time.

... GMT] [info] [<0.112.0>] Stacktrace: [{couch_httpd_db,handle_request,
[{httpd,
{mochiweb_request,
[#Port<0.4455>,'GET',"//",
{1,1},
{8,
{"host",
{'Host',"localhost:5984"},
{"accept",
{'Accept',
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
nil,
{"accept-language",
{'Accept-Language',"en-US,en;q=0.5"},
{"accept-encoding",
{'Accept-Encoding',"gzip, deflate"},
nil,nil},
{"cookie",
{'Cookie',
"__utma=111872281.618741229.1391889742.1391889742.1391889742.1; __utmz=111872281.1391889742.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
TimeChoice=sweber"},
{"connection",
{'Connection',"keep-alive"},
{"cache-control",
{'Cache-Control',"max-age=0"},
nil,nil},
etc...





________________________________
 From: Alexander Shorin <kxepal@gmail.com>
To: "user@couchdb.apache.org" <user@couchdb.apache.org>; Scott Weber <scotty2541@sbcglobal.net>

Sent: Sunday, April 13, 2014 10:23 PM
Subject: Re: Handle the Welcome Request
 

You probably would like to copy _utils global handler config value instead.
--
,,,^..^,,,



On Mon, Apr 14, 2014 at 7:14 AM, Scott Weber <scotty2541@sbcglobal.net> wrote:
> Greetings again,
> I am trying to handle the Welcome message that appears from a root request.
> I am using version 1.5 on a Windows machine.
>
>
> Specifically I want to direct the "/" request to another url.
> After hours of searching, the closest I found was this:
>
>
> https://issues.apache.org/jira/browse/COUCHDB-472
> which describes putting the changes in the [httpd_global_handlers] section.
>
> So I followed the changes documented at18/Aug/09 14:43
> I replaced the root handler with both suggestions in the log. Neither worked, they gave
me a "500 server error".
> For example I set this:
>
>
> / = {couch_httpd_misc_handlers, handle_welcome_req, {<<"Welcome">>,"/me/there/page.html"}}
>
> In the couch log, I get:
> httpd 500 error response:
>  {"error":"json_encode","reason":"{bad_term,{<<\"Welcome\">>,\"/me/there/page.html\"}}"}
>
>
> Is there any other solution to this?
>
> -Scott
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message