Skip to content

Instantly share code, notes, and snippets.

@robwormald
Created January 6, 2014 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwormald/8289686 to your computer and use it in GitHub Desktop.
Save robwormald/8289686 to your computer and use it in GitHub Desktop.
module.exports.adapters = {
default: 'postgresql',
postgresql : {
//etc
},
rest: {
module: 'sails-rest',
type: 'json', // expected response type (json | string | http)
host: 'api.somewhere.io', // api host
port: 80, // api port
protocol: 'http', // HTTP protocol (http | https)
pathname: '/api/v1' // base api path
resource: null, // resource path to use (overrides model name)
action: null, // action to use for the given resource ([resource]/run)
query: {}, // query parameters to provide with all GET requests
methods: { // overrides default HTTP methods used for each CRUD action
create: 'post',
find: 'get',
update: 'put',
destroy: 'del'
},
beforeFormatResult: function(result){return result}, // alter result prior to formatting
afterFormatResult: function(result){return result}, // alter result after formatting
beforeFormatResults: function(results){return results}, // alter results prior to formatting
afterFormatResults: function(results){return results}, // alter results after formatting
cache: { // optional cache engine
engine : require('someCacheEngine')
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment