This module creates an HTTP API based on the models defined by the database given in the database configuration.
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:33443Look at all the models:
http://localhost:33443/modelsInclude the fields:
http://localhost:33443/models?include=fieldsAnd their links:
http://localhost:33443/models?include=fields.linkOrder by the field slugs:
http://localhost:33443/models?include=fields.link&order=fields.slug%20descLimit to 3:
http://localhost:33443/models?include=fields.link&order=fields.slug%20desc&limit=3Only include models who have a "Name" field:
http://localhost:33443/models?include=fields.link&order=fields.slug%20desc&limit=3&where=fields.name:Name
You can control what can be accessed by the API by using middleware
available in the caribou.api.middleware
namespace.
Copyright (C) 2012 Instrument
Distributed under the MIT License.