view-service-client
v0.1.1
Published
A Node.js client for https://github.com/revelrylabs/view-service.
Downloads
2
Maintainers
Readme
view-service-client
A Node.js client for https://github.com/revelrylabs/view-service.
Example
var createViewServiceClient = require('view-service-client');
var viewServiceClient = createViewServiceClient('http://localhost:8000');
var viewName = 'home/index';
viewServiceClient.hasView(viewName, function(err, doesHaveView) {
if(err) {
throw err;
}
if(doesHaveView) {
viewServiceClient.renderView(viewName, {my: 'var'}, function(err, renderedOutput) {
if(err) {
throw err;
}
console.log(renderedOutput);
}
} else {
console.log('Did not find view with name ' + viewName);
}
});