The fodmap ingredient API.
Information about low fodmap ingredients are scattered about the web, in plain text, images, web apps, etc. This API is an effort to put all low fodmap ingredients into a single place to make them easier to find.
This is a work in progress!
To start the server from the CLI run:
clj -M:start
This starts a server at localhost:3000
A health check (this should return true!)
curl "http://localhost:3000/api/ingredients"
Get list of all ingredients.
curl "http://localhost:3000/api/ingredients"
Search for ingredients that match the query q
curl "http://localhost:3000/api/ingredients?q=melon"
Get a single ingredient by its id.
curl "http://localhost:3000/api/ingredients/1"
Delete a single ingredient by its id.
curl -X DELETE "http://localhost:3000/api/ingredients/1"
Create a single ingredient.
curl -X POST -d '{"name": "Test Ingredient", "info": "none", "type":"moderate","category":"fruit"}' "http://localhost:3000/api/ingredients"
Update a single ingredient by its id.
curl -X POST -d '{"name": "Better Alfalfa", "info": "none", "type":"moderate","category":"fruit"}' "http://localhost:3000/api/ingredients/1"
The given type
and category
need to exist for this to be successful.
Get a list of all types.
curl "http://localhost:3000/api/types"
Get a single category by its id.
curl "http://localhost:3000/api/types/1"
Create a single type.
curl -X POST -d '{"name": "Test Type"}' "http://localhost:3000/api/types"
Update a single type by its id.
curl -X POST -d '{"name": "unsafe"}' "http://localhost:3000/api/types/1"
Delete a single type by its id.
curl -X DELETE "http://localhost:3000/api/type/1"
This will not work if the type is being used by an ingredient.
Get a list of all categories.
curl "http://localhost:3000/api/categories"
Get a single category by its id.
curl "http://localhost:3000/api/categories/1"
Create a single category.
curl -X POST -d '{"name": "Test Category"}' "http://localhost:3000/api/categories"
Update a single category by its id.
curl -X POST -d '{"name": "veggies"}' "http://localhost:3000/api/types/1"
Delete a single category by its id.
curl -X DELETE "http://localhost:3000/api/categories/1"
This will not work if the category is being used by an ingredient.