I am working with a REST URL that looks like this:
/users/<user_id>/entities
This URL returns data containing 2 objects as follows:
{
"players":
{
"test_player2":
{
"_id": "test_player2",
"user": "f07590567f3d3570b4f35b4fd79f18b3"
},
"test_playerX":
{
"_id": "test_player2",
"user": "f07590567f3d3570b4f35b4fd79f18b3"
}
},
"games":
{
"game1" :{},
"game2" :{},
}
}
I am figuring out how to structure my Backbone Objects in order to utilize this data effectively.
My goal is to create two separate Backbone objects: Player and Game, both of which should be populated using the same URL mentioned above.
One question that arises is whether it is considered proper practice to design a REST URL in this manner?