@switzerly
shelbyswitzer.com
getnotion.com
Civic hacking with hypermedia API containers
{
"business" : {
"name" : "Hairy Convenience",
"lat" : "33.760094",
"lng" : "-84.386037",
"bustype" : "convenience"
}
}
document:
mapping:
{
"business" : {
"properties" : {
"name" : { "type" : "string" },
"lat" : { "type" : "string" },
"lng" : { "type" : "string" },
"bustype" : { "type" : "string" },
"FILE_SOURCE": { "type": "string"},
}
}
}
{
"collection" :
"href" : "http://dockerip:4567/resources/",
"items" : [
{
"href" : "http://dockerip:4567/resources/8903493",
"data" : [
{"name" : "name", "value" : "Bob's Convenience Store"},
{"name" : "lat", "value" : "33.760094"},
{"name" : "lng", "value" : "-84.386037"},
{"name" : "bustype", "value" : "convenience"},
{"name" : "FILE_SOURCE", "value" : "GA_EBT.csv"}
]
}
],
"queries" : [
{"rel":"search", "href":"http://dockerip:4567/resources/search", "prompt":"Search",
"data" : [
{"name" : "name", "value" : ""},
{"name" : "lat", "value" : ""},
{"name" : "lng", "value" : ""},
{"name" : "bustype", "value" : ""},
{"name" : "FILE_SOURCE", "value": ""},
{"name" : "dedupe", "value" : ""}
]
}
]
}
api:
build: ./api
command: bash ./deploy/start.sh
volumes:
- api:/api
ports:
- "4567:4567"
links:
- elastic
elastic:
image: dockerfile/elasticsearch
ports:
- "9200:9200"
- "9300:9300"
volumes:
- docker_volumes/elasticsearch_data:/usr/local/elasticsearch/data
docker-compose.yml
$ docker-compose up -e ORIGIN_REPO="switzersc/food-data"
$ curl http://dockerip:4567/resources?dedupe=bustype
https://github.com/switzersc/api-in-a-box
http://www.codeforamerica.org/brigade/
@switzerly
shelbyswitzer.com
getnotion.com
https://github.com/switzersc/api-in-a-box
https://hub.docker.com/r/switzersc/api-in-a-box/
http://www.elastic.co/guide/en/elasticsearch/guide/current/index.html
http://amundsen.com/media-types/collection/
https://www.data.gov/developers/apis