Replies: 1 comment 4 replies
-
Hey, it's not something that's currently supported. Partly because it's technically tricky since Encore API endpoints have different signatures, and partly because a lot of the common use cases for middleware (logging, tracing, authentication, request serialization/deserialization, etc) are already supported or will be supported through a different approach. We definitely need to support middleware in some form, though. But first I'd love to understand your use case a bit more. What sort of usage data? Encore does automatically track certain metrics for you (available in the cloud console), and we could expose those over an API of some kind. In the short term though, the easiest would probably be to define a helper method of some kind that you call at the start of each endpoint to collect the usage data, if that would work for your use case. |
Beta Was this translation helpful? Give feedback.
-
Small question: I want to record some usage data whenever all endpoints on a specific service are being called and I was thinking of doing something like a middleware I'd add to the service. Is there any way to do so with encore? Or would there be another recommended way of doing this kind of pattern with encore?
Beta Was this translation helpful? Give feedback.
All reactions