Router mergerParams setting on app initialization
- Dominant language
- JavaScript
- Stars
- 69.5k
- Forks
- 25k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
Hi,
is there way to make app merge params from the parent app right now? As far as I can tell only the strict and caseSensitive settings are configurable:
https://github.com/expressjs/express/blob/33e8dc303af9277f8a7e4f46abfdcb5e72f6797b/lib/application.js#L144-L149
https://github.com/expressjs/express/blob/318fd4b543ffbebf97bf0b6c49188afae45741f5/lib/application.js#L64-L75
My use case is that I have the root app and child apps for view rendering, because I am able to limit the views available to the app, which makes code a bit shorter and cleaner and also project structure is nicer. However I don't have the access to the path parameters in this case.
```javascript
const root = express()
const app = express()
app .set('views', 'path1')
app .get('/', (req) => console.log(req.params)) // prints '{}'
root.use('/path/:someParam', app)
```
I can submit a PR as it is only one line of code if I didn't overlook something.
Contributor guide
Assessment
This issue has not been assessed yet.