You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the routes object includes a meta property, but it’s empty by default.
I’d like to know how to inject data into this meta property so I can retrieve it on the frontend. For example, I’d like to include information such as the required role to access a route, a description of the route, or any other useful data.
I’ve tried several approaches, but I haven’t figured out how to properly populate this field when defining routes. Here’s what I’m currently doing to define my routes:
However, when I use Route.toJSON(), the meta object remains empty.
Is there a specific configuration I need to enable or another way to pass this data?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone,
I’m currently working on an application using AdonisJS v6. When I retrieve the list of routes via
Route.toJSON()
, I get a JSON object like this:I noticed that the routes object includes a
meta
property, but it’s empty by default.I’d like to know how to inject data into this
meta
property so I can retrieve it on the frontend. For example, I’d like to include information such as the required role to access a route, a description of the route, or any other useful data.I’ve tried several approaches, but I haven’t figured out how to properly populate this field when defining routes. Here’s what I’m currently doing to define my routes:
However, when I use
Route.toJSON()
, themeta
object remains empty.Is there a specific configuration I need to enable or another way to pass this data?
Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions