Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
HTTP based API for caribou
Clojure

Merge pull request #6 from Frozenlock/master

Allow user to ask for nested fields
Failed to load latest commit information.
autodoc
src/caribou/api
test/caribou_api/test
.gitignore
README.md
project.clj

README.md

Caribou API

This module creates an HTTP API based on the models defined by the database given in the database configuration.

Usage

Add the API routes into your caribou project by using the build-api-routes function in the caribou.api.routes namespace.

Assuming you added it to your root path:

Navigate to it:

http://localhost:33443
Look at all the models:
http://localhost:33443/models
Include the fields:
http://localhost:33443/models?include=fields
And their links:
http://localhost:33443/models?include=fields.link
Order by the field slugs:
http://localhost:33443/models?include=fields.link&order=fields.slug%20desc
Limit to 3:
http://localhost:33443/models?include=fields.link&order=fields.slug%20desc&limit=3
Only include models who have a "Name" field:
http://localhost:33443/models?include=fields.link&order=fields.slug%20desc&limit=3&where=fields.name:Name

Middleware

You can control what can be accessed by the API by using middleware available in the caribou.api.middleware namespace.

License

Copyright (C) 2012 Instrument

Distributed under the MIT License.

Something went wrong with that request. Please try again.