Auto file extension lookup with multiple view engines
Open
- Dominant language
- JavaScript
- Stars
- 69.5k
- Forks
- 25k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
It is possible to select a default view extension with `app.set('view engine', 'html');`. This is fine when you only use one view engine - you can only set this once. But if I then add a second view engine, I must specify the file extension when calling render on these views. Express should be smart enough to lookup the view name with all of the registered view engines:
app.engine('html', cons.underscore);
app.engine('pug', require('pug').__express);
This should suffice for both registering the view engines and adding to the list of extensions to search for when referencing a view name without an extension
Contributor guide
Assessment
This issue has not been assessed yet.