-
-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(transport-commons): Ability to register routes with custom params #2482
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.