https://github.com/hyperoslo/hyper-recipes
https://github.com/hyperoslo/hyper-recipes
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hyperoslo/hyper-recipes
- Owner: hyperoslo
- Created: 2015-03-10T14:08:59.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-17T17:01:22.000Z (over 10 years ago)
- Last Synced: 2024-05-09T16:36:38.457Z (about 2 years ago)
- Language: Ruby
- Homepage:
- Size: 2.79 MB
- Stars: 16
- Watchers: 19
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
This is the backend for the Hyper Recipes app. To be able to use it, you will need an access token that your contact inside Hyper will provide you with when you begin your quest. This is helpful so other applicants don't modify your recipes in any way.
The base HTTP endpoints is: `http://hyper-recipes.herokuapp.com`
## Retrieve recipes
`GET`: `/recipes`
Sample:
```json
[
{
"id": 437,
"name": "Strawberries and Cream Cake",
"description": "Makes an elegant presentation without too much fuss.",
"instructions": "eee",
"favorite": false,
"difficulty": 3,
"created_at": "2014-09-29T10:43:00.072Z",
"updated_at": "2014-11-26T11:53:58.451Z",
"photo": {
"url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/437/Strawberries_and_Cream_Cake.jpg",
"thumbnail_url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/437/thumbnail_Strawberries_and_Cream_Cake.jpg"
}
}
]
```
In Curl it would be something like that:
```
curl -H 'Authorization: Token token="replace-with-token"' http://hyper-recipes.herokuapp.com/recipes
```
## Create recipes
`POST`: `/recipes`
* **name:string** (obligatory field)
* **difficulty:integer** (obligatory field) [Valid values: 1, 2 and 3]
* description:text
* instructions:text
* favorite:boolean
* recipe[photo]:image == Multipart form request
Sample:
```json
{
"recipe": {
"name": "New name",
"difficulty": 1
}
}
```
In Curl it would be something like that:
```
curl -H 'Authorization: Token token="2e3e72bbbcfd13eb27f4"' -d "recipe[name]=Meatballs" -d "recipe[difficulty]=1" http://hyper-recipes.herokuapp.com/recipes
```
## Update recipes
`PUT` or `PATCH`: `/recipes/:id`
* **name:string** (obligatory field)
* **difficulty:integer** (obligatory field) [Valid values: 1, 2 and 3]
* description:text
* instructions:text
* favorite:boolean
* recipe[photo]:image == Multipart form request
Sample:
```json
{
"recipe": {
"name": "New name",
"difficulty": 1
}
}
```
In Curl it would be something like that:
```
curl -H 'Authorization: Token token="0b71145b7474d575632b"' -d "recipe[name]=Meatballzz" -d "recipe[difficulty]=2" -X PUT http://hyper-recipes.herokuapp.com/recipes/22
```
## Delete recipes
`DELETE`: `/recipes/:id`
In Curl it would be something like that:
```
curl -H 'Authorization: Token token="0b71145b7474d575632b"' -X DELETE http://hyper-recipes.herokuapp.com/recipes/22
```