In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Documentation of API used for this project.
API URL: https://exercise.cngroup.dk/api
Types are derived from the API results, some field might be missing!
{
_id: Int,
title: string !required,
preparationTime: Int,
servingCount: Int,
directions: string
ingredients: Array[Ingredient],
slug: string,
lastModifiedDate: Date,
isMarkdown: Boolean
sideDish: string
__v: Int
}
{
_id: Int,
name: string,
amount: Int,
amountUnit: string,
isGroup: Boolean
}
- Method: GET
- Returns: List all available recipes
- Method: GET
- :slug can be replaced with :id
- Returns: All information available about recipe (based on slug or id)
- Method: GET
- Returns: List of all ingredients avaliabel, lists only their names in string array.
- Method: GET
- Returns: List of all side-dishes, string array.
-
Method: POST
-
Content-type: application/json
-
Creates a new recipe
-
Required fields and default values:
{ title: String, //required field for user preparationTime: Int, servingCount: Int, sideDish: String, directions: String, ingredients: Array<{ amount: Int, amountUnit: String, isGroup: Boolean, name: String, }> } -
Returns: Simplified recipe object, same that is returned in recipe list or error.
- Method: POST
- Content-type: application/json
- Edits an existing recipe
- Only edited fields can be sent
- Returns: Simplified recipe object, same that is returned in recipe list or error.
- Method: DELETE
- Deletes existing recipe
- Returns: 200 OK