original app settings aren't inherited for subapps
See original GitHub issueIs your feature request related to a problem? Please describe.
I have setup a subapp with new App()
and used it for a login page. I have also set up a few middlewares and the pug view engine in the parent app instance. However, it keeps logging:
(node:23948) UnhandledPromiseRejectionWarning: TypeError: this.engines[options.ext] is not a function
Describe the solution you’d like res.render in the sub app should render the page.
Describe alternatives you’ve considered I have tried setting the same engine property in the subapp and it works fine, which is annoying because I don’t want to copy the settings to each subapp.
Additional context Maybe you could add a { inherit: booelan } property to the app options upon constructing a new app instance? That way people can choose not to inherit those properties. By the way, this also applies to app.set(“views”, …) and not just the view engine.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
@creepinson you can solve it using a simple function:
please put it in the separate issue because it’s not related to the original issue