Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C56A9109B5 for ; Tue, 8 Oct 2013 02:48:54 +0000 (UTC) Received: (qmail 43693 invoked by uid 500); 8 Oct 2013 02:48:51 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 43155 invoked by uid 500); 8 Oct 2013 02:48:46 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 43147 invoked by uid 99); 8 Oct 2013 02:48:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 02:48:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of robert.newson@gmail.com designates 209.85.216.47 as permitted sender) Received: from [209.85.216.47] (HELO mail-qa0-f47.google.com) (209.85.216.47) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 02:48:40 +0000 Received: by mail-qa0-f47.google.com with SMTP id k4so3420806qaq.6 for ; Mon, 07 Oct 2013 19:48:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=HrF5y1wleKm3teGwr5M2L9K+sgOIzvaVws30x1IfWks=; b=i9gZWCcwisCh8vXvcZM7REZEG2ihIJ0XV3ACwkDyOizqaMGq7hl4aZJLNzrmwET3B7 nvE1j7066Ix/es/ovrxBlc4FPs0jPaiSmdD2RE1U+2BOWcSfufNLTfw0J7QUF8xnmMaa 8PYYa2XUO2lf2S/TdW4VrkL01jdutj8qgpSRs9EYbmNEM9NcppJDmh48mfm/Rk5xQdmz V2CxBRBBkAUFY7kzbgeGfjs5Ij1kX0ljBG66Gywlzl823wMYKoYF5N95Qr2lgeBWDbhD XIBliPWFP0JZmHlty9OjdlZZmPqc0Al6IaDoPVrw6y/VRgIvJLvoWxvDzzw+FlpL1/xk ZtYA== X-Received: by 10.49.84.6 with SMTP id u6mr12279272qey.79.1381200499109; Mon, 07 Oct 2013 19:48:19 -0700 (PDT) Received: from [192.168.0.27] (c-76-119-239-252.hsd1.ma.comcast.net. [76.119.239.252]) by mx.google.com with ESMTPSA id og1sm33347763qeb.3.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 19:48:16 -0700 (PDT) From: Robert Newson Content-Type: multipart/signed; boundary="Apple-Mail=_0D7338AF-4361-4320-B754-B7E9B0CC5532"; protocol="application/pgp-signature"; micalg=pgp-sha512 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Having troubles with rewrites Date: Mon, 7 Oct 2013 22:48:09 -0400 References: To: user@couchdb.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_0D7338AF-4361-4320-B754-B7E9B0CC5532 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 https://wiki.apache.org/couchdb/Rewriting_urls http://docs.couchdb.org/en/latest/configuring.html#http-rewrite-handler B. On 7 Oct 2013, at 21:24, Stanley Iriele wrote: > I'm in a movie but you need the full path to the rewrites = section..also > your rewrites path is wrong..it should be > rednecks/_design/rednecks/_rewrites..And your rewrites.json file = should be > in that place in your design doc ..just to be safe restart your = database... > Via _restart...hope that helps > On Oct 7, 2013 5:01 PM, "Mark Deibert" wrote: >=20 >> Ok so now I've added a rewrites.js file to my Couchapp root folder. = In this >> js file I have... >>=20 >> [ >> { >> "method": "GET", >> "from": "/home", >> "to": "app/index.html", >> } >> ] >>=20 >>=20 >> Now when I push the Couchapp, in CouchDB in my _design/rednecks I see = it's >> creating a "rewrites" property with the above js. So this looks all = good to >> me. This is how to do this right? >>=20 >> I changed my local.ini vhost to... >>=20 >> [vhosts] >> rnr.couchdb:5984 =3D /rednecks/_design/rednecks >>=20 >>=20 >> In Chrome I enter url... >>=20 >> http://rnr.couchdb:5984/home >>=20 >> I get same error... >>=20 >> {"error":"not_found","reason":"Document is missing attachment"} >>=20 >>=20 >> That index.html attachment is absolutely there. I can see it. The app >> runs fine if I disable this rewrite garbage. I've tried every >> variation of the "to" string that I can think of and all I see is = that >> same error above. >>=20 >> Does _anyone_ know how to do this?!?!?!.... >>=20 >>=20 >>=20 >>=20 >> On Mon, Oct 7, 2013 at 6:47 PM, Mark Deibert >> wrote: >>=20 >>> I have Couchapp. It's working fine. Today, sadly, I decided to try >>> rewrites. I'm having a good bit of trouble with this. Docs offer = very >>> minimal help. Not sure where my gears are stuck. >>>=20 >>> Here is my local.ini vhosts entry... >>>=20 >>> [vhosts] >>> rnr.couchdb:5984 =3D /rednecks/_design/_rewrites >>>=20 >>>=20 >>> I created a _design/_rewrites doc in the rednecks db. Here is it's >>> content... >>>=20 >>> { >>> "_id": "_design/_rewrites", >>> "_rev": "8-1cd78f53e0b21331bc9f9d8d33d1725b", >>> "rewrites": [ >>> { >>> "from": "home", >>> "to": "/_design/rednecks/app/index.html", >>> "method": "GET", >>> "query": { >>> } >>> } >>> ] >>> } >>>=20 >>>=20 >>> In Chrome I enter http://rnr.couchdb:5984/home and I get this = error... >>> {"error":"not_found","reason":"Document is missing attachment"} >>>=20 >>>=20 >>> It seems to me that the "to" in the rewrite is not finding the = design >> doc and it's attachment. That doc definitely does exist because the = app >> runs great if I turn off the rewrite and just enter the full ugly = path. >>>=20 >>> The _design/rednecks and the _design/_rewrites docs are in the same >> path/folder in Couch. The info in docs.couchdb.org, section 3.7 is = very >> light. It doesn't even mention how the "to" path is figured. =46rom = what path >> does it start? No mention of that. Nice docs. In the CouchDB Wiki, = they've >> cut/pasted the same documentation and added almost zero additional = info. >> Someone did attempt to add the "to" path info at the bottom, but it's = not >> really English that I can understand. So that's not helpful. >>>=20 >>> So... I'm hoping someone here can help me get unstuck :-) >>>=20 >>> Thanks for any advice, >>>=20 >>> Mark >>>=20 >>>=20 >>>=20 >>>=20 >>=20 --Apple-Mail=_0D7338AF-4361-4320-B754-B7E9B0CC5532 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJSU3JtAAoJEBAV9o+doki8K/4P/0u68wON71f65QRIJTBZzZAr cI7WQwmU3g9r9G2f6vl86ddPhAAuD9WVVWX1CnSjIX2CIuAvFYLW5vHbTUUziP+Q 3CnG2rIUtLl5oiZZpLbJql8xDYOSNsLW1F5R5Ur+GCQKm82fA4BwuPM2Uz3/PWpO bPIiljL63SngIRW/qXzueo4G4GqeLmea1t7XmmvEmRILEVz5TGEeQ1O+noR4ReQ3 Ei3+DM31bD1c5G3mvOsIPUyHifPA8ZlPn0nToKKNvr/8FRUQgyZ+dAvZSP9vVlGb kZJyMwbALCfDJAxvEhAdnvQpiHpKtgCw4wK5q6LFloz8eYMNwNgDk2JIC+Ig4Wwb kttVs87baXp/J01SE5Jb9oG0klupcUCpXDqR0roq4ypteezRaqc49v44TmDifnBm CfC1364Vh9tZDTCeCOh9jYod+T8C15gFwe8C3toa9WCxws5weUSyIZPDkug9fxBm pvXAh/exmmwDbh/pNFhrfm+pCX6zMeMlxzaMQMywwCSiFEnjheHeJkl4UgRdwvXF FfH9O9F1MxOiI8d+E436GtbAWA057ojydDxDxtVwQTFYTf/oHPr6yOqLJ3nSIxzA jLEjXzmhLxgO+hbdARYstRZvv2Aq4b+/KpBhta2Qqp8HtXCIa34RL3BwCFXLEPsx LzaYnQIUc9tMkJLIl1sN =+TYs -----END PGP SIGNATURE----- --Apple-Mail=_0D7338AF-4361-4320-B754-B7E9B0CC5532--