moleculerjs / moleculer-web

:earth_africa: Official API Gateway service for Moleculer framework
http://moleculer.services/docs/moleculer-web.html
MIT License
292 stars 119 forks source link

apply autoAliases only where there is a rest setting. #296

Closed swkim0572 closed 2 years ago

swkim0572 commented 2 years ago

Dynamic routing with autoAliases

It seems good to apply only those with rest configuration.

Several services are using a common mixin.

Those were not intended to apply autoAliases.

But if you use autoAliases, a router is created for all previous actions.

I think that actions to apply autoAliases should use rest configuration

The following settings are required autoAliases: { restOnly: true }

In addition, I would like to be able to configure middleware in rest configuration.

icebob commented 2 years ago

Dynamic routing adds only actions where rest is configured in action definition: https://github.com/moleculerjs/moleculer-web/blob/65b7addddc3dc34856d2a3bf6fe202664b2e033c/src/index.js#L1495

swkim0572 commented 2 years ago

Oh I found it moleculer-db uses rest configuration. I use moleculer-db as common mixin.

Is only moleculer-db issue ? I want to exclude molevuler-db from autoAliases.

swkim0572 commented 2 years ago

thank you for your kind