ejs
ejs copied to clipboard
Support for Express 'view engine' extension setting in 'include' statement
Hello, I found and fixed next problem with 'include' statement: when I set 'view engine' setting via Express (app.set('view engine', 'html') for example) I can put filepath of the view in the 'res.render' function without extension, but when I want put filepath without extension in 'include' statement in view it will cause an error, because default extension for included files is only '.ejs'. I fixed this issue by adding support for extension from 'view engine' option when it set.
+1
+1
+1
good job!
I was wondering why this wasn't already the case, was about to write this up myself and submit a pull request when I saw that this one was here from so long ago. Is there a reason this can't be pulled in? Is there any disadvantage or reason I shouldn't do something similar to this if I want to use the .html
extension?
@CoryG89, I have same questions! Can someone merge it?