/yummy

Primary LanguageJavaScript

Local Development API Server

Architecture

Local server

  • Node.js
  • Express.js

Getting Started

Development local API Server

Location of server = /server Server depends on node.js LTS Version: v10.16.0 Please make sure you have these installed before proceeding forward.

Great, you are ready to proceed forward; awesome!

Let's start with running commands in your command line interface (CLI)

Install project dependancies
# npm install
Start the server
# node server

Endpoints

GET Endpoints

Get all recipes

http://localhost:3000/api/recipes/

Get a recipe by id

http://localhost:3000/api/recipes/<id>

POST Endpoints

Create a new recipe

http://localhost:3000/api/recipes/
Parameters
{
    "title": <recipe_title>,
    "ingredients": <ingredients>,
    "instructions": <instructions>,
    "time to prepare": <preparation_time>,
    "difficulty": <difficulty_number>
}

PUT Endpoints

Update a recipe

http://localhost:3000/api/recipes/<id>
Parameters
{
    "title": <recipe_title>,
    "ingredients": <ingredients>,
    "instructions": <instructions>,
    "time to prepare": <preparation_time>,
    "difficulty": <difficulty_number>
}

DELETE Endpoints

Delete a recipe

http://localhost:3000/api/recipes/<id>