You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Chris Sphinx <ch...@gmail.com> on 2013/03/30 23:57:02 UTC

Finding Files with VHost

Hey guys, I've got a quick question. I'm using a vhost and _rewrite to 
serve up a webpage and I'm trying to get the page to include a separate 
javascript file.

http://184.75.155.16.xip.io:5984

Script is running fine, but I'm using a rewrite to point it correctly:

[
     {
        "from": "",
        "to": "index.html"
     },
     {
         "from": "hello.js",
         "to": "script/hello.js"
     }
]

I'm wondering if there is a better way to do this? Or do I need a 
rewrite for every file I'm going to be using on my page? How do I set 
the src path correctly if I'm using vhost and _rewrite?

- Chris

Re: Finding Files with VHost

Posted by Chris Sphinx <ch...@gmail.com>.
In fact, because of my _rewrite, now every request I make with $.couch 
is screwed up. I must be going about this wrong way, how can I serve an 
app using vhost & _rewrite if I can't access any information from the 
couch using jquery? Including the scripts from /_utils/scripts works 
directly OR from the vhost, but _active_tasks doesn't? Why is this?

- Chris


On 3/30/13 6:57 PM, Chris Sphinx wrote:
> Hey guys, I've got a quick question. I'm using a vhost and _rewrite to 
> serve up a webpage and I'm trying to get the page to include a 
> separate javascript file.
>
> http://184.75.155.16.xip.io:5984
>
> Script is running fine, but I'm using a rewrite to point it correctly:
>
> [
>     {
>        "from": "",
>        "to": "index.html"
>     },
>     {
>         "from": "hello.js",
>         "to": "script/hello.js"
>     }
> ]
>
> I'm wondering if there is a better way to do this? Or do I need a 
> rewrite for every file I'm going to be using on my page? How do I set 
> the src path correctly if I'm using vhost and _rewrite?
>
> - Chris


Re: Finding Files with VHost

Posted by Ryan Ramage <ry...@gmail.com>.
Chris,

This is what erica generates as a default for rewrites:

https://github.com/benoitc/erica/blob/master/priv/templates/webstyle/_ddoc/rewrites.json

the
"from": "/*", "to": "*"


basically is the kitchen sink rewrite that will get all your script/*,
img/* etc working.



On Sat, Mar 30, 2013 at 4:57 PM, Chris Sphinx <ch...@gmail.com> wrote:

> Hey guys, I've got a quick question. I'm using a vhost and _rewrite to
> serve up a webpage and I'm trying to get the page to include a separate
> javascript file.
>
> http://184.75.155.16.xip.io:**5984 <http://184.75.155.16.xip.io:5984>
>
> Script is running fine, but I'm using a rewrite to point it correctly:
>
> [
>     {
>        "from": "",
>        "to": "index.html"
>     },
>     {
>         "from": "hello.js",
>         "to": "script/hello.js"
>     }
> ]
>
> I'm wondering if there is a better way to do this? Or do I need a rewrite
> for every file I'm going to be using on my page? How do I set the src path
> correctly if I'm using vhost and _rewrite?
>
> - Chris
>