You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 3 methods that are implemented with this API:
GET on the endpoint /plants (returns info about the plants)
What it returns:
A JSON object containing all plant info in the database, along with a 201 HTTP status.
[
{
"id": "a randomly generated ID from Mongo",
"name": "the biological name of the plant",
"image": "plant image from Google"
}
// and more of these
]
GET on the endpoint /plant/:id (returns info about a specific plant)
What it returns:
A JSON object containing the ID and the randomly generated JWT for an existing user, along with a secondary token and a 201 HTTP status.
{
"_id": "a randomly generated ID from Mongo",
"name": "the biological name of the plant",
"image": "plant image from Google"
}
// directly from Mongo
POST on the endpoint /water/:id (sends a request to activate a water pump for a plant)
The plant ID should be parseable from the URL (using req.params).