I'm building an application related to donation on streams.
And I have such models as "alert"
and "alert-template"
.
"alert"
is a set of different parameters to understand when alert about donation should be displayed.
"alert-template"
is a visual config for the "alert" (image, audio, positioning).
At the end, on stream, it should look like this:
And I'm working now on the streamer part, where he can manage these alerts.
I have a page /alerts
and on this page I need to request all alerts for the user including alert-template.
In which way should it be done?
- create a backend that is able to process route like
api/alerts?include="alert-template"
- create a backend focused directly to pages of the frontend application and then route
api/frontend/alerts
will contain already all needed data including alerts and alert-templates - create a backend that just has 2 separate routes for
alert
andalert-template
and somehow handle it in this way
I tried to find any information on the internet about how to handle nested objects in api and tried to understand whether it is normal practice to have them, but unfortunately, there was not much info about it.