Field | Type | Notes |
---|---|---|
id | integer | primary key |
string | required and unique | |
password | string | required |
username | string | required |
firstname | string | required and unique |
lastname | string | required and unique |
Field | Type | Notes |
---|---|---|
id | integer | primary key and autoincrements |
userId | string | required |
title | string | name of recipe |
source | text | who created the recipe |
ingredients | string | food or components needed for recipe |
instructions | text | steps to make recipe |
categories | string | which region or culture the recipe is from |
BASE URL:
test account:
{
"email": "[email protected]",
"username": "test123",
"password": "test",
"firstname": "johnny",
"lastname": "test"
}
REQUEST | URL | Notes |
---|---|---|
GET | /api/users |
gets all users from database |
GET | /api/users/:id |
gets back a specific user with given id |
POST | /api/users/ |
creates a new user |
PUT | api/users/:id |
updates a user record |
REQUEST | URL | Notes |
---|---|---|
POST | /api/recipes |
create a new recipe;title &ingredients a must |
PUT | /api/recipes/:id |
updates a recipe given an id value; required |
DELETE | /api/recipes/:id |
deletes a recipe given an id value; required |
GET | /from/:id |
gets all recipes from a user given the id |
GET | /api/recipes/ |
gets all recipes |
REQUEST | URL | Notes |
---|---|---|
POST | /api/auth/register |
registers a new user |
POST | /api/auth/login |
users logs in |