ryancoughlin / Snowcast-Sever

Fetches resort conditons and weather information.
0 stars 0 forks source link

API Endpoints #6

Open ryancoughlin opened 8 years ago

ryancoughlin commented 8 years ago

Currently use:

api/near Example: api/near?distance=3&latitude=43.66&limit=4&longitude=-72.79

Returns a list an array of resorts near the user. This distance is in radians which I need to convert to miles. I need to hunt for some math on that.

I have this as well

api/get-resort-info/:id

This will return data for a single resort. As of now I am not using this. I am fetching all resorts near the user based on their distance and limit. I create all of the resort objects and use that. I don't request each resort when the detail VC loads. Since they're so light, that makes sense right?

Weather:

api/weather-from-id/:id

I use this now to fetch resort and weather data in one request. Should we remove this and I can call forecast.io directly from the client or do want to keep it so we can exclude specific keys from the request.

ryancoughlin commented 8 years ago

@mattapperson Made some notes here, let me know your thoughts.

ryancoughlin commented 8 years ago

Loading all the resorts and creating objects at once works for now, but I am trying to think when I want to have browsing and sort by resorts with most snow. I dont want to build resort objects for say all resorts in the US. I would want to request some info to make the tableview then request data for that single resort when needed:

I am user in Maine browsing resorts in CO and want to see what the top snow is there (say highest base depth)

ryancoughlin commented 8 years ago

A browse screen could have a filter by state or all of the resorts sorted by the most baseDepth or seasonTotal - not needed now but i'll add that. I mention that if it helps inform any decisions now.