Support for Express 'view engine' extension setting in 'include' statement #95

wants to merge 1 commit into

6 participants


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.

@melnaron melnaron added ability to use 'include' statements without extension in filepa…
…th when using EJS with Express and when view files has not .ejs extensions

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment