forked from rbrandonc/Vacation-Destination-Finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
database-schema.txt
69 lines (66 loc) · 1.54 KB
/
database-schema.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Database Schema
{
"id": <ObjectID>,
"dateCreated": <String>,
"startingLatitude": <float>,
"startingLongitude": <float>,
"startingLocationName": <string>,
"distance": <int>,
"nearbyLocationLatitude": <float>,
"nearbyLocationLongitude": <float>,
"nearbyLocationName": <string>,
"day 0": { // nearby location weather data
"date": <string>,
"weather": <string>,
"low": <string>,
"high": <string>,
"icon": <string>
},
"day 1": {
"date": <string>,
"weather": <string>,
"low": <string>,
"high": <string>,
"icon": <string>
},
"day 2": {
"date": <string>,
"weather": <string>,
"low": <string>,
"high": <string>,
"icon": <string>
},
"day 3": {
"date": <string>,
"weather": <string>,
"low": <string>,
"high": <string>,
"icon": <string>
},
"day 4": {
"date": <string>,
"weather": <string>,
"low": <string>,
"high": <string>,
"icon": <string>
},
}
REST Description
- /destinations
- GET: all destinations
- Request is any GET to the url
- Response is all of the json destination entries
- /destination
- POST: create a new destination
- Request is a POST containing a creation date, name, location, and description
- Response is a json destination entry
- /destination/:id
- GET: a single destination by ID
- Request includes an ID
- Response is a json destination with the matching ID
- PUT: update a destination (unneeded?)
- Request includes an ID and which fields to update
- Response is the updated object
- DELETE: remove a destination by ID
- Request is an ID
- No response