i basically have an expressjs application with the following dirs:
app/views
and
app/plugin/views
and would like to be able to serve from both directories.
how will this work?
i tried setting
app.set('views', second_dir)
but then my app wont find my first view directory.
then i tried symlinking the folder,
fs.exists(viewDir, function() {
fs.symlink(viewDir, rootViewDir, 'dir', function(err) {
console.log('adding symlink with err: '+err+ ' in viewdir ='+viewDir+' rootDir ='+rootViewDir);
});
});
this works, creates the symlink (permanently),
but node is not able to read symlinked views as it seems.
is there a solution for my dilemma?
thanks a lot,
have fun
jascha
found this video by tj holowaychuk
where he just creates additional express applications for the plugins.
http://vimeo.com/56166857
he also specially mentions inheritance of “global” variables in the comments of the video,
which means that the app.locals and stuff like that should be the same in every express app in the chain of apps and plugins, this will be put to the test now 🙂
anyways, just wanted to answer my own question with an answer i originally dismissed without testing (because i didnt assume that this global linkage of variables exists 😉 )
have fun
jascha