Sha256: 98f6632f6c7ab1b2001c52271641fd4a3d2b934a70a69ff1dfa15c158507c26b

Contents?: true

Size: 1.94 KB

Versions: 54

Compression:

Stored size: 1.94 KB

Contents

var NUTELLA = require('../src/nutella_lib')

// Initialize nutella
//var p = NUTELLA.parseURLParameters();    // This only works in the browser
var p = NUTELLA.parseAppComponentArgs();
console.log(p)
var nutella = NUTELLA.init('ltg.evl.uic.edu', 'my_app_id', 'my_run_id', 'demo_node_bot');
nutella.setResourceId('r_id');
nutella.log.test();
nutella.net.publish('channel', 'message');
nutella.persist.test();      // this should only work in node
nutella = NUTELLA.initApp('ltg.evl.uic.edu', 'my_app_id', 'demo_node_bot');
nutella.app.net.test();
nutella.app.log.test();
nutella.app.persist.test();



//    // Subscribe to a channel
//    nutella.net.subscribe("demo1", function(message, c_id, r_id) {
//        console.log('Received "' +  JSON.stringify(message) + '" from ' + c_id + '/' + r_id);
//        nutella.net.unsubscribe('demo1');
//    });

//    // Wildcard subscribe
//    nutella.net.subscribe("demo2/#", function(message, channel, c_id, r_id) {
//        console.log('Received "' +  JSON.stringify(message) + '" on channel ' + channel + ' from ' + c_id + '/' + r_id);
//    });

//    // Publish some stuff
//    nutella.net.publish('demo1');
//    nutella.net.publish('demo1', 'just a string');
//    nutella.net.publish('demo1', {a: 'proper', key: 'value'});
//    nutella.setResourceId('a_particular_resource');
//    nutella.net.publish('demo1');
//    nutella.net.publish('demo1', 'just a string');
//    nutella.net.publish('demo1', {a: 'proper', key: 'value'});

    // Handle requests
    //nutella.net.handle_requests('demo1', function(message, component_id, resource_id) {
    //    return 'this is the returned value';
    //});
    //
    //// Perform a couple requests
    //nutella.net.request('demo1', function(response) {
    //    console.log("This is the response to empty request (GET)");
    //});
    //
    //nutella.net.request('demo1', 'my_request', function(response) {
    //    console.log("This is the response to non-empty request");
    //});

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
nutella_framework-0.9.2 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.9.1 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.9.0 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.8.0 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.7.3 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.7.2 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.7.1 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.7.0 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.21 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.20 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.19 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.18 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.17 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.16 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.15 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.13 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.12 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.11 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.10 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js
nutella_framework-0.6.9 example_framework_components/example_framework_web_interface/node_modules/nutella_lib/examples/node_hello_world.js