Created
March 16, 2012 05:13
-
-
Save jhs/2048587 to your computer and use it in GitHub Desktop.
Failing node-couchapp Kanso application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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