feat(transport-commons): Ability to register routes with custom params#2482
feat(transport-commons): Ability to register routes with custom params#2482daffl merged 3 commits intofeathersjs:dovefrom
Conversation
0710fa6 to
44b9e66
Compare
44b9e66 to
ed65302
Compare
|
Yep, can definitely see that being useful. I think we can also add it to the new service options (https://dove.docs.feathersjs.com/api/application.html#use-path-service-options) to make it more integrated: app.use('/messages', new MyService(), {
methods: [ 'get', 'doSomething' ],
events: [ 'something' ],
params: { something: 'here' }
}); |
|
One question that i had when looking through code: Is it possible to register same instance of a service on different routes? This line makes me think that this possibility was thought about at some point. If yes then it means that you can pass server options only during first If no then shouldn't |
|
Great, thank you! This looks good to me. Good point about re-using the options. Can we put up a test for this to see what would be a good way to go about that? The goal was basically to
|
|
Hm... if plugins will provide their own options using Other question: |
|
You're right, the service options should be a different PR/issue. The problem with changing the router in Express is that things like custom service middleware (and any other middleware matching Express routes which are not compatible with this router) won't work anymore. |
Allows to add routes with some predetermined route params which are not placeholder based.