Skip to content

Instantly share code, notes, and snippets.

@jhs
Last active December 13, 2015 16:58
Show Gist options
  • Save jhs/4944188 to your computer and use it in GitHub Desktop.
Save jhs/4944188 to your computer and use it in GitHub Desktop.
// Service all /_couchdb/* requests for CouchDB
//
module.exports = handle_http
function handle_http(req, res) {
res.writeHead(200, 'OK')
res.end('Hello to CouchDB!\n')
}
$ curl -i 127.0.0.1.xip.io:5984
HTTP/1.1 200 OK
Date: Wed, 13 Feb 2013 12:18:26 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Hello to CouchDB!
{�"name":"nodecouch-example"
,"version":"0.0.1"
,"couchdb": { "main": "./couchdb.js"
, "vhosts": ["127.0.0.1.xip.io"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment