Skip to content

Instantly share code, notes, and snippets.

@rsbohn
Created December 15, 2011 17:56
Show Gist options
  • Save rsbohn/1482086 to your computer and use it in GitHub Desktop.
Save rsbohn/1482086 to your computer and use it in GitHub Desktop.
How I got node.couchdb.js working on Windows
REM Set up workspace
mkdir \work\node_modules
cd \work\node_modules
REM check out modules
cmd /c git clone https://github.com/mikeal/node.couchapp.js.git couchapp
cmd /c git clone https://github.com/mikeal/request.git
cmd /c git clone https://github.com/mikeal/watch.git
REM create my_app
mkdir \work\my_app
cd \work\my_app
REM skeleton couchapp in .\node_modules
mkdir node_modules
echo var couchapp=require("couchapp");>node_modules\app.js
echo var ddoc={_id: "_design/app"};>>node_modules\app.js
echo module.exports=ddoc;>>node_modules\app.js
REM get working copy of the couchapp command
copy \work\node_modules\couchapp\bin.js .
sed s/.\/main.js/couchapp/ bin.js > couchapp.js
del bin.js
REM Ready to go!
REM set cred=rsbohn:secret
REM curl -XPUT http://%cred%@localhost:5984/seed
REM node.exe couchapp.js push app http://%cred%@localhost:5984/seed
REM curl http://localhost:5984/seed/_design/app
@rsbohn
Copy link
Author

rsbohn commented Dec 15, 2011

Just to clarify, I install node.couchapp.js (and dependencies) in \work\node_modules. My couchdb design docs are in \work\my_app\node_modules. I copy bin.js from couchapp to the local directory, patch it, then run it on the command line. This way my couchdb code is isolated from the couchapp tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment