Deployed here: https://bestbudapp.herokuapp.com/
POST /api/auth/signup
Body:
{
username: string,
password: string
}
The username
value must be unique for every user.
Upon successful sign up, the user's id
and a token
is returned.
POST /api/auth/signin
Body:
{
username: string,
password: string
}
Upon successful sign in, the user's id
and a token
is returned.
POST /api/strains
Body:
{
limit: number,
offset: number
}
There are about 1500 strains, so you don't want to load them all at once.
Example:
{
limit: 30,
offset: 60
}
This will return 30 results, skipping the first 60. This is ideal for pagination.
POST /api/strains/query
Body:
{
filter: string,
query: string,
limit: number,
offset: number
}
You can filter by name
, flavors
, race
, positive_effects
, negative_effects
, medical_conditions
, and rating
.
The query
for rating
is still a string.
GET /api/strains/:id
Parameter | Type | Description |
---|---|---|
:id |
string |
Strain ID |
GET /api/cabinet/:id
Parameter | Type | Description |
---|---|---|
:id |
string |
User ID |
POST /api/cabinet/:id
Parameter | Type | Description |
---|---|---|
:id |
string |
User ID |
Body:
{
strain_id: number
}
DELETE /api/cabinet/:id
Parameter | Type | Description |
---|---|---|
:id |
string |
Cabinet ID |
POST /api/recommender
Body:
{
input: string
}
bestBud returns the following status codes in its API:
Status Code | Description |
---|---|
200 | OK |
201 | CREATED |
400 | BAD REQUEST |
401 | UNAUTHORIZED |
404 | NOT FOUND |
500 | INTERNAL SERVER ERROR |