-
-
Notifications
You must be signed in to change notification settings - Fork 16.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options for Engines #3114
base: 5.0
Are you sure you want to change the base?
Options for Engines #3114
Conversation
* Added option to skip filesystem checks
Can you have different view engine options for different view engines? Or do all engines ends up with the same options? |
Well, if no engine options are given, it uses app.get('view engine options') or {} as a fallback. But I've added a parameter to app.engine which lets you pass options for a specific engine. |
Ah. Can you describe this feature a bit more so I can understand it? We will also need to understand it in order to write up the documentation. Is there a use case for having many view engines use the same options? |
Basically, this PR changes the following:
In short, all this really does right now is add the functionality to bypass the filesystem-specific logic associated with engines, so non-filesystem engines (like ones using databases as described in the linked issue) are possible. |
@dougwilson What's the status of this PR? |
This is inspired by #2982. It adds an option object to engines, and adds an option for bypassing the filesystem mapping and checks done in view.js.
Alternatively, this option could be used to bypass the
if (!view.path) {
check in application.js:565, or even to assignview.path = name
somewhere around there.Either way, I think it'd be a good idea to have options for engines.
Put into the 5.0 branch because it's a breaking change.