Skip to content

Instantly share code, notes, and snippets.

@jhs
Created March 16, 2012 05:13
Show Gist options
  • Save jhs/2048587 to your computer and use it in GitHub Desktop.
Save jhs/2048587 to your computer and use it in GitHub Desktop.
Failing node-couchapp Kanso application
// Example node-couchapp Kanso application.
//
var fs = require('fs')
var ddoc = module.exports = { 'views':{} }
fs.readdirSync(__dirname + '/views').forEach(function(file) {
var match = file.match(/^(.+)\.js$/)
, mod = match && match[1]
if(mod)
ddoc.views[mod] = require('./views/' + file)
})
{ "name" : "example"
, "version": "0.1.0"
, "description": "Example Kanso app which breaks with node-couchapp"
, "dependencies": { "node-couchapp": "0.8.3"
}
, "app": "app"
, "modules_attachment": false
}
// XXX: This should be views/a_view.js but Gist wont't let me do that.
exports.map = function(doc) {
emit(doc._id, 1)
}
exports.reduce = function(keys, vals, rereduce) {
return null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment