strongloop/loopback-datasource-juggler — pull request #199 by fabien (2014-08-01 07:41:11+00:00)
Title: Customize/Normalize class-level remoting http path

Some ways to specify the handling of the http path generation:

``` javascript
// Path setting
var User = ds.define('UserAccount', {name: String, bio: String}, { path: 'accounts' }); // setting
console.log(User.http.path); // result: '/accounts'

// Normalization
ModelBuilder.normalizePathName = true; // global
ModelBuilder.prototype.normalizePathName = true; // global/dataSource/runtime
var User = ds.define('UserAccount', {name: String, bio: String}, { normalize: true }); // setting
console.log(User.http.path); // result: '/user-accounts'

// Advanced, custom
ModelBuilder.normalizePathName = function(pathName, className, properties, settings, parent) {
return 'data/' + pathName;
};

```