use
npm run dev
Parameter | Type | Description |
---|---|---|
success | boolean | the status of request |
message | string | message for each request |
POST /login
Parameter | Type | Description |
---|---|---|
string | ||
password | string | password |
Example
{
"email": "leklek@gmail.com",
"password": "123"
}
{
"message": "Login sucessful",
"userId": xxx,
"token": "xxxxxx"
}
200
OK
noted: If success the Respond will be sent with cookie named token
POST /register
Parameter | Type | Description |
---|---|---|
username | string | name |
string | ||
password | string | password |
Example
{
"name": "123",
"email": "123@gmail.com",
"password": "123"
}
OK
200
OK
POST /create
Parameter | Type | Description |
---|---|---|
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
Example
{
"recipe_name": "Mock Recipe",
"description": "TestTest",
"cook_time": 30,
"is_favourite": false,
"rating": 4.5,
"direction": "blablabla",
"tool": "ABC DEF GHI",
"ingredient": "dddd uuuu",
"likes": 10,
"user_id": 1,
"Breakfast": true,
"lunch": false,
"Gluten_Free": true,
"Dinner": true,
"image_link": "https://example.com/image.jpg"
}
{
"success": true,
"message": "Recipe created successfully"
}
200
OK
PUT /edit
Parameter | Type | Description |
---|---|---|
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
Example
{
"recipe_name": "Spaghetti Bolognese",
"description": "Classic Italian pasta dish with meat sauce",
"cook_time": 45,
"is_favourite": false,
"rating": 4.5,
"direction": "blablabla",
"tool": "ABC DEF GHI",
"ingredient": "dddd uuuu",
"likes": 10,
"Breakfast": false,
"lunch": true,
"Gluten_Free": false,
"Dinner": true,
"image_link": "https://example.com/spaghetti_bolognese.jpg"
}
{
"success": true,
"message": "Recipe updated successfully"
}
200
OK
DELETE /delete/recipe_id
No Request Body
{
"success": true,
"message": "Recipe deleted successfully"
}
200
OK
GET /recipes
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
likes | int | password |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
Example
{
"recipe_name": "Spaghetti Bolognese",
"description": "Classic Italian pasta dish with meat sauce",
"cook_time": 45,
"is_favourite": false,
"rating": 4.5,
"likes": 10,
"Breakfast": false,
"lunch": true,
"Gluten_Free": false,
"Dinner": true,
"image_link": "https://example.com/spaghetti_bolognese.jpg"
}
GET /recipes/:recipeId
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
success | boolean | status |
id | string | id of recipe |
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
error | string | error |
Example
{
"success": true,
"data": [
{
"id": 25,
"recipe_name": "123456",
"description": "5453",
"cook_time": 0,
"is_favourite": 0,
"rating": 4,
"direction": "atrmk",
"tool": "jkgr",
"ingredient": "jblkjbw",
"likes": 0,
"user_id": 12,
"Breakfast": 0,
"Lunch": 1,
"Gluten_Free": 0,
"Dinner": 0,
"image_link": "https://assets.epicurious.com/photos/5a7894d5c6aea21096d5582f/1:1/w_3671,h_3671,c_limit/Filipino-Cure-for-the-Common-Cold-31012018.jpg"
}
],
"error": null
}
GET /recipes/user/:user_id
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
success | boolean | status |
id | string | id of recipe |
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
error | string | error |
Example
{
"success": true,
"data": [
{
"id": 25,
"recipe_name": "123456",
"description": "5453",
"cook_time": 0,
"is_favourite": 0,
"rating": 4,
"direction": "atrmk",
"tool": "jkgr",
"ingredient": "jblkjbw",
"likes": 0,
"user_id": 12,
"Breakfast": 0,
"Lunch": 1,
"Gluten_Free": 0,
"Dinner": 0,
"image_link": "https://assets.epicurious.com/photos/5a7894d5c6aea21096d5582f/1:1/w_3671,h_3671,c_limit/Filipino-Cure-for-the-Common-Cold-31012018.jpg"
}
],
"error": null
}
GET /recipes/Fav/:user_id/
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
success | boolean | status |
id | string | id of recipe |
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
error | string | error |
Example
{
"success": true,
"data": [
{
"id": 25,
"recipe_name": "123456",
"description": "5453",
"cook_time": 0,
"is_favourite": 0,
"rating": 4,
"direction": "atrmk",
"tool": "jkgr",
"ingredient": "jblkjbw",
"likes": 0,
"user_id": 12,
"Breakfast": 0,
"Lunch": 1,
"Gluten_Free": 0,
"Dinner": 0,
"image_link": "https://assets.epicurious.com/photos/5a7894d5c6aea21096d5582f/1:1/w_3671,h_3671,c_limit/Filipino-Cure-for-the-Common-Cold-31012018.jpg"
}
],
"error": null
}
GET /sort/breakfast
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
success | boolean | status |
id | string | id of recipe |
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
error | string | error |
Example
{
"success": true,
"data": [
{
"id": 25,
"recipe_name": "123456",
"description": "5453",
"cook_time": 0,
"is_favourite": 0,
"rating": 4,
"direction": "atrmk",
"tool": "jkgr",
"ingredient": "jblkjbw",
"likes": 0,
"user_id": 12,
"Breakfast": 1,
"Lunch": 1,
"Gluten_Free": 0,
"Dinner": 0,
"image_link": "https://assets.epicurious.com/photos/5a7894d5c6aea21096d5582f/1:1/w_3671,h_3671,c_limit/Filipino-Cure-for-the-Common-Cold-31012018.jpg"
}
],
"error": null
}
GET /sort/lunch
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
success | boolean | status |
id | string | id of recipe |
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
error | string | error |
Example
{
"success": true,
"data": [
{
"id": 25,
"recipe_name": "123456",
"description": "5453",
"cook_time": 0,
"is_favourite": 0,
"rating": 4,
"direction": "atrmk",
"tool": "jkgr",
"ingredient": "jblkjbw",
"likes": 0,
"user_id": 12,
"Breakfast": 1,
"Lunch": 1,
"Gluten_Free": 0,
"Dinner": 0,
"image_link": "https://assets.epicurious.com/photos/5a7894d5c6aea21096d5582f/1:1/w_3671,h_3671,c_limit/Filipino-Cure-for-the-Common-Cold-31012018.jpg"
}
],
"error": null
}
GET /sort/gluten
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
success | boolean | status |
id | string | id of recipe |
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
error | string | error |
Example
{
"success": true,
"data": [
{
"id": 25,
"recipe_name": "123456",
"description": "5453",
"cook_time": 0,
"is_favourite": 0,
"rating": 4,
"direction": "atrmk",
"tool": "jkgr",
"ingredient": "jblkjbw",
"likes": 0,
"user_id": 12,
"Breakfast": 1,
"Lunch": 1,
"Gluten_Free": 1,
"Dinner": 0,
"image_link": "https://assets.epicurious.com/photos/5a7894d5c6aea21096d5582f/1:1/w_3671,h_3671,c_limit/Filipino-Cure-for-the-Common-Cold-31012018.jpg"
}
],
"error": null
}
GET /sort/dinner
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
success | boolean | status |
id | string | id of recipe |
recipe_name | string | name |
description | string | |
cook_time | int | password |
is_favourite | boolean | name |
rating | int | |
direction | string | step to do |
tool | string | tool to use |
ingredient | string | ingredient |
likes | int | password |
user_id | int | id of user |
Breakfast | boolean | name |
lunch | boolean | |
Gluten_Free | boolean | password |
Dinner | boolean | |
image_link | string | password |
error | string | error |
Example
{
"success": true,
"data": [
{
"id": 25,
"recipe_name": "123456",
"description": "5453",
"cook_time": 0,
"is_favourite": 0,
"rating": 4,
"direction": "atrmk",
"tool": "jkgr",
"ingredient": "jblkjbw",
"likes": 0,
"user_id": 12,
"Breakfast": 1,
"Lunch": 1,
"Gluten_Free": 0,
"Dinner": 1,
"image_link": "https://assets.epicurious.com/photos/5a7894d5c6aea21096d5582f/1:1/w_3671,h_3671,c_limit/Filipino-Cure-for-the-Common-Cold-31012018.jpg"
}
],
"error": null
}
GET /user
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
id | int | id of user |
name | string | name |
string | ||
password | string | password |
Example
{
"id": 5,
"name": "Johny",
"email": "johny@example.com",
"password": "$2b$10$IGkdoSRMikhFu50SBL9F5.fs92f7kIWVdjZboaloolJdBa25h3mza"
},
{
"id": 8,
"name": "Nanon",
"email": "nanon@gmail.com",
"password": "$2b$10$8gsRSdMAMsom897M7HA1FudIm9UlSqhCzWTET/SL3VlWLdfrkJXLu"
}
GET /user/:user_id
No Request Body
200
OK
Respnse
Parameter | Type | Description |
---|---|---|
no parameter | Array of recipe | all recipe |
the recipe object
Parameter | Type | Description |
---|---|---|
id | int | id of user |
name | string | name |
string | ||
password | string | password |
Example
{
"id": 12,
"name": "phing",
"email": "phing@gmail.com",
"password": "$2b$10$Vp8/S6A70Vw3/90OJt7TPeTH/g8MEaYWD4BAswqmYS9g5WyZWTHkS"
}