Provides easy access to RESTful APIs, inline with the SOON API spec, from Sails.js & Waterline.
This module is a Waterline/Sails adapter, an early implementation of a rapidly-developing, tool-agnostic data standard. Its goal is to provide a set of declarative interfaces, conventions, and best-practices for integrating with all sorts of data sources. Not just databases-- external APIs, proprietary web services, or even hardware.
Strict adherence to an adapter specification enables the (re)use of built-in generic test suites, standardized documentation, reasonable expectations around the API for your users, and overall, a more pleasant development experience for everyone.
To install this adapter, run:
$ npm install sails-restful// api/models/Queue.js
module.exports = {
adapter: 'restful',
url: '/player/queue'
};
// config/connections.js, add:
restful: {
module: 'sails-restful',
host: 'api.thisissoon.fm',
port: 443,
protocol: 'https',
headers: {}
}
This adapter implements the semantic interface and exposes the following methods:
GET one or more records.
POST a new record.
PUT to a record.
DELETE a record.
Support for the subscribable interface is planned.
For more information, check out this repository's FAQ and the adapter interface reference in the Sails docs.
Check out Connections in the Sails docs, or see the config/connections.js file in a new Sails project for information on setting up adapters.
Configure the interfaces you plan to support (and targeted version of Sails/Waterline) in the adapter's package.json file:
In your adapter's directory, run:
$ npm testSee FAQ.md.
- Stackoverflow
- #sailsjs on Freenode (IRC channel)
- Tutorials
Sails is free and open-source under the MIT License.
