couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MK>
Subject code sharing across databases
Date Sat, 04 Jun 2011 19:08:20 GMT
I have a few databases with _design pages that include modules
which get used within views/shows etc via require, eg:

doc.password = require("lib/sha1").sha1(req.form.pass);

These are all generic.  Right now, they are part of the _design,
meaning they are replicated for each database, which is a bit of a
hassle if they are changed (I have to update all the db's they are used
in).  Is there a way I can require(code) within a _design from an
independent database of common functions, so that I can just make
changes to that and not have to recreate the _design for every db?

I am not using couchapp (and won't be) altho I did steal the /lib idea
from there.

"Enthusiasm is not the enemy of the intellect." (said of Irving Howe)
"The angel of history[...]is turned toward the past." (Walter Benjamin)

View raw message