Browsers can only request data served from the same domain as the host. Stick your HTML file in CouchDB as a binary attachment to fix this. More info in the second part of this article.
$.couch.app() behind a vhost?Here is a rewrite rule that makes the application's database available through the vhost
And here is how you hint to the $.couch.app() the ddoc URL without it having to inspect it from the document.location.
SInce 0.7, couchapp contains the "autopush" extension. To install it, add these lines to your setting file .couchapprc:
{
"extensions": [
"egg:couchapp#autopush"
]
}
Then launch autopush server in the couchapp folder :
couchapp autopush --update-delay 10 . testdb
This command send changes every 10 seconds to the testdb database. autopush
use linux inotify API if pyinotify module is installed. Eventlet is required for this feature.
This happens when your editor keeps the old unchanged file around, e.g. by appending a ~. Then couchapp loads both the new and the old version of the file and (as Murphy dictates) the old version wins.
Solution: see the next point on how to make couchapp ignore those backup files.
A .couchappignore file specifies intentionally untracked files that couchapp should ignore. It's a simple json file containing an array of regexps that will be use to ignore file.
For example:
[
".*\\.swp$",
".*~$"
]
will ignore all files ending in .swp and ~ . Be sure to leave out the final , in the list.
You can check if couchapp really ignores the files by specifying the -v option: couchapp -v push ...
Note: windows doesn't like files that only have an extension, so creating the .couchappignore file will be a challenge in windows. Possible solutions to creating this file are :
touch .couchappignorecd /to/couchappand then notepad .couchappignoreSince the contents of the reduce.js file associated with each view is properly escaped and then inserted into the design document as a quoted string, all you need to do to use one of the built-in reduce functions is insert one of the following lines into the file (without quotes or whitespace):
_sum
_count
_stats