Get node.couchapp:
git clone https://github.com/mikeal/node.couchapp.js.git
cd node.couchapp.js
install globally:
npm install -g
install locally, where test
is the directory name which will contain your app:
cd ..
cd test
npm install ".\..\node.couchapp.js"
create the most basic app.js
file as so:
var couchapp = require('couchapp')
var ddoc = {_id:'_design/app', shows:{}, updates:{}, views:{}, lists:{}};
exports.app = ddoc;
For some reason using node couchapp <command> app.js http://address.to.couch/database
failed to work on windows. As of 2012-03-15 I received the following error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '<path_to_directory>\test\couchapp'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
Instead I had to use the following to upload the app to couchdb:
node "./node_modules/couchapp/bin.js" push app.js http://address.to.couch/database
or with authentication I used:
node "./node_modules/couchapp/bin.js" push app.js http://username:[email protected]/database