In Vatican.requestHandler there is the snippet
var hdlr = this.loadHandler(process.cwd() + "/" + methodFound.handlerPath)
If options.handlers is defined as relative path all it's ok. If options.handlers is defined as absolute paths the methodFound.handlerPath is an absolute path and the expression process.cwd() + "/" + methodFound.handlerPath will give something like
/home/ppp//home/ppp/tt/dd
plus an error of reading the directory.
Maybe
- to import
path module
- rewrite function
Vatican.parseHandlers
Vatican.prototype.parseHandlers = function(cb) {
...
var dir = path.isAbsolute(this.options.handlers) ? this.options.handlers : process.cwd() + "/" + this.options.handlers;
...
}
- rewrite
Vatican.requestHandler
Vatican.prototype.requestHandler = function(req, res) {
...
var hdlr = this.loadHandler( methodFound.handlerPath)
...
}
In Vatican.requestHandler there is the snippet
If options.handlers is defined as relative path all it's ok. If options.handlers is defined as absolute paths the
methodFound.handlerPathis an absolute path and the expressionprocess.cwd() + "/" + methodFound.handlerPathwill give something likeplus an error of reading the directory.
Maybe
pathmoduleVatican.parseHandlersVatican.requestHandler