madstreetden
v0.0.1
Published
Hapi plugin for Mad Street Den
Downloads
2
Readme
MadStreetDen
MadStreetDen is a Node.js plugin for integrating MadStreetDen Visual Recommendation API into hapi and Express Frameworks.
Hapi Usage
Valid Options for Hapi:
url
: mandatory MadStreetDen Recommendation EndpointappID
: mandatory App ID allocated by MadStreetDenappSecret
: mandatory App Secret Key allocated by MadStreetDenpath
: default -/recommend
identifier
: query string identifier, default -q
numResults
: default -50
tags
: Hapi route tagsconnections
: Hapi server connections
Usage:
var Hapi = require('hapi');
var MadStreetDen = require('madstreetden');
var server = new Hapi.Server();
server.connection();
var options = {
url: '<MadStreetDen URL>',
appID: '<MadStreetDen provided appID>',
appSecret: '<MadStreetDen provided appSecret>'
};
server.register({register: MadStreetDen, options: options }, function(err){
console.log(err);
});
Express Usage
Valid Options for Express:
url
: mandatory MadStreetDen Recommendation EndpointappID
: mandatory App ID allocated by MadStreetDenappSecret
: mandatory App Secret Key allocated by MadStreetDenidentifier
: query string identifier, default -q
numResults
: default -50
var Express = require('express');
var MadStreetDen = require('madstreetden');
var options = {
url: '<MadStreetDen URL>',
appID: '<MadStreetDen provided appID>',
appSecret: '<MadStreetDen provided appSecret>'
};
var server = Express();
server.get('/recommend', MadStreetDen(options));
server.listen({ port: 3000});