0.1.0 • Published 11 years ago
sails-hook-gravatar v0.1.0
sails gravatar hook
why
I needed a simple plug-in to experiment around sailsjs extensions.
what
It decorates a given model with a new method "gravatar" that outputs a gravatar url.
By default, it will decorate User and search for an email property to perform the md5 hash.
If you want to override those, you can create a config.gravatar object, having the following structure :
{
    model: 'ModelName',
    field: 'fieldName'
}It will also create a custom route get /<ModelName>/:id/gravatar for your api, and responds a formatted message:
{
    url: 'GravatarUrl'
}You can disable this by adding route: false to the configuration object.
how
npm install sails-hook-gravatarthat's it.
0.1.0
11 years ago