moleculerjs / site

:globe_with_meridians: Official website for Moleculer
https://moleculer.services
22 stars 71 forks source link

Selecting streaming mode when using autoAliases seems hard to find in documentation #172

Closed gautaz closed 5 months ago

gautaz commented 2 years ago

Hello,

In order to select streaming mode when using autoAliases, one has to define the rest section of its action the following way:

actions: {
  actionName: {
    rest: {
      method: 'POST',
      path: '/some/action/path',
      type: 'stream',
    }
  }
}

The only example detailing this that I have found in the documention is available here: https://moleculer.services/docs/0.14/moleculer-web.html#File-upload-aliases

In this example the type is set to multipart. It was not clear, at least to myself, that this type could also be set to stream when defining a rest section. Moreover, this example does not deal with auto aliases (I agree that this is just the section next to it but I did not relate both examples at first).

@icebob Is this on purpose (meaning we should not use the type field in a rest section) or is this the right way to go (in which case, the documentation could probably be improved)?

gautaz commented 5 months ago

Spring cleaning time! There is no need to keep this issue anymore, feel free to reopen a new one if needed.