Closed vevmesteren closed 8 years ago
UPDATE When I run
#forever /myapp/bin/www
from root I get the same issue.
when I do
#cd /myapp
#forever bin/www
it works as expected, seems that forever and paths don't play nice.
Seems like I am on the right path... -p is not the answer as one might think due to the help. I need to set --sourceDir then it works, trying this from init.d entry and will report back here.
And that was it
here's the way that the service now looks to make the templating work properly
command="node"
nodeApp="/bin/www"
foreverApp="forever"
nodeAppDir="/myapp/"
and the start command now looks like so
$foreverApp start --sourceDir=$nodeAppDir --pidFile $pidFile -l $logFile -a -d $nodeApp -c "$command" $nodeApp
Reading through your main.js to see if I can create a patch for this
This is not directly related, but the issue I am experiencing only happens when I start the app through the generated init.d entry.
When I start the application manually like so
all is well, and res.render works charmingly and as expected.
When I start the app through the service though,
views-engine is setup and configured like so
console.log(__dirname) outputs
in both cases, so it seems that the app knows where it's at. Just trying to drill myself in there to figure out if it's express-handlebars that breaks or if it's due to the app running through the service.
Here is the error
The file is there, and renders perfectly find when not app is run directly rather then service.
Any pointers whatsoever would be great
thanks