0.0.1 • Published 10 years ago
madstreetden v0.0.1
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 -/recommendidentifier: query string identifier, default -qnumResults: default -50tags: 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 -qnumResults: 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});0.0.1
10 years ago