The back end of Rank Tank
> npm install
> node app
Hit the url http://localhost:3000/index.html
for a shiny landing page.
A work in progress
Ordered composite of all users' rankings. Includes all items.
- Option1
[
{ "id" : "3", "title" : "c"},
{ "id" : "1", "title" : "a"},
{ "id" : "2", "title" : "b"},
{ "id" : "4", "title" : "d"}
]
- Option2
[
{ "rank": "1", "id" : "3", "title" : "c"},
{ "rank": "2", "id" : "1", "title" : "a"},
{ "rank": "2", "id" : "2", "title" : "b"},
{ "rank": "4", "id" : "4", "title" : "d"}
]
One user's personal ranking
lower index = higher priority
get
/ranks/user/steven
[
{ "id" : "3", "title" : "c"},
{ "id" : "2", "title" : "b"},
{ "id" : "1", "title" : "a"}
]
get
/ranks/user/sam
[
{ "id" : "3", "title" : "c"},
{ "id" : "1", "title" : "a"},
{ "id" : "4", "title" : "d"}
]
What's stored in the service
{
"steven" : [
{ "id" : "3", "title" : "c"},
{ "id" : "2", "title" : "b"},
{ "id" : "1", "title" : "a"}
],
"sam" : [
{ "id" : "3", "title" : "c"},
{ "id" : "1", "title" : "a"},
{ "id" : "4", "title" : "d"}
]
}
Example usage:
return userrankings[params.userid]