Skip to content

Instantly share code, notes, and snippets.

@streunerlein
Created May 24, 2012 23:20
Show Gist options
  • Select an option

  • Save streunerlein/2784839 to your computer and use it in GitHub Desktop.

Select an option

Save streunerlein/2784839 to your computer and use it in GitHub Desktop.

Revisions

  1. streunerlein revised this gist May 29, 2012. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,15 @@
    var couchconfig = {
    hostname: "localhost"
    }

    var nano = require("./nano/nano.js")("http://localhost:5984"),
    var nano = require("./nano/nano.js")("http://" + couchconfig.hostname + ":5984"),
    db = nano.use("nano-test"),
    express = require("express");

    var app = express.createServer();

    app.get('/', function(req, res){
    req.headers.host = couchconfig.host;
    nano.request({
    db: "nano-test",
    doc: "test",
  2. streunerlein created this gist May 24, 2012.
    17 changes: 17 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@

    var nano = require("./nano/nano.js")("http://localhost:5984"),
    db = nano.use("nano-test"),
    express = require("express");

    var app = express.createServer();

    app.get('/', function(req, res){
    nano.request({
    db: "nano-test",
    doc: "test",
    att: "latest-xkcd.png",
    headers: req.headers
    }).pipe(res);
    });

    app.listen(3000);