Skip to content

ptct-secret-recipes-3/front-end

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ptct-Secret-Recipes-3

API Endpoints:

  • Login: [POST]/api/login checks users login credentials against the database

  • Register: [POST]/api/register tests users credentials against the db and stores it

    CRUD Endpoints (GET/POST/UPDATE/DELETE)
    • [GET] /api/recipes returns an array of recipes (or an empty array if there aren't any).
    • [GET] /api/recipes/:id returns a recipe by the given id.
    • [POST] /api/recipes returns the created recipe.
    • [PUT] /api/recipes/:id returns the updated recipe.
    • [DELETE] /api/recipes/:id returns the deleted recipe.

DATA SCHEMAS

(Back-end: Create Seeds & Migration tables using Knex) Please remember it is critical that you create your state exactly as you see the JSON output above, otherwise, you will not be able to access the db.

LOGIN (user)
field data type
username string, required
password string, required
  • returned JSON example:

    {

    "username": "Wrenley",
    
    "password": "Willow1357"
    

    }

REGISTER (user)
field data type
username string, required
password string, required
email string, not required
  • returned JSON example:

    {

      "username": "Wrenley",
    
      "password": "Willow1357",
    
      "email": "[email protected]"
    

    }

RECIPES SCHEMA (recipe)

field data type metadata
id unsigned integer primary key, auto-increments, generated by database
title string required, unique
source string required
ingredients string required
instructions array required
category string optional
  • returned JSON example:

recipes

[

{
    "id": 1,
    "title": "Kumandra Stew",
    "source": "Raya and Sisu",
    "ingredients": "water, ginger, noodles, tumeric, lemonzest",
    "instructions": ["directly infuse compassion and perspective", "Add 2 cups of water"],
    "category": "soups & stews"

},
{
    "id": 2,
    "title": "Lasagna",
    "source": "Luca",
    "ingredients": "pasta, marinara, mozzarella",
    "instructions": ["hop on your vespa", "ride into town to buy cheese", "boil water"],
    "category": "pasta"

}

]


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published