Skip to content

caribou/caribou-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

HTTP based API for caribou

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •