How do I use Nano?

Here are some Ideas

  • DATA STREAM TASKS

    Use Nano to process data streams, such as, tracking users activity, processing orders, analysis on click streams, data sanitation, generating metrics, manipulating logs, analyzing social media events.

  • TRANSFORM

    Perform compute heavy data transformations in your databases such as, counting, data validation, filtering, sorting, and more. Great for data science!

  • CONNECTED DEVICES

    Send real-time connected device sensor data streams to Nano Lambda for analysis to generate actionable insight. Even use it to meter connected devices for billing.

  • EVENT DRIVEN

    Nano Lambda can be used to execute code in reaction to events. When a change happens in your data or system, Nano can execute code in response.

  • API FRAMEWORK

    Containerize your endpoints and have them become fault-tolerant and horizontally scalable. Gain better API visibility with our trace tool.

  • ENHANCE

    Use Nano Lambda to add micro-services to your web and mobile applications to enhance user experience.

Sign Up

Micro-Service

Library

Use these examples at your own desecration.
Contribute to this library by emailing us here: [email protected]

Send An SMS via Twilio

Invoke Command:

~$ curl -X POST 'https://{{your_lambda_url}}/v1/services/{{lambda_name}}/twilio' \
                        -d 'number={{number_to}}&message=Hello World!'  \
                        -u {{your_AuthToken}}:[AuthToken]
          

// Save this code as server.js
// Get the packages we need
var app = require('express')(),
    server = require('http').Server(app),
    path = require('path'),
    bodyParser = require('body-parser'),
    port = process.env.PORT || 3000, //**REQUIRED TO LISTEN ON PORT 3000
    methodOverride = require('method-override'),
    client = require('twilio')('{{your_twilio_key}}', '{{your_twilio_secret}}');

app.use(bodyParser.json());
app.use(bodyParser.json({type: 'application/vnd.api+json'}));
app.use(bodyParser.urlencoded({extended: true}));
app.use(methodOverride('X-HTTP-Method-Override'));

app.post('/twilio', function (req, res) {
  console.log('Number'+ req.body.number);
  console.log('Message'+ req.body.message);

  //Send an SMS text message
  client.sendSms({
      to:req.body.number, // Any number Twilio can deliver to
      from: '+{{your_from_twilio_number}}', // A number you bought from Twilio
      body:req.body.message// body of the SMS message
  }, function(err, responseData) { //this function is executed when a response is received from Twilio
      if (!err) { 
          console.log(responseData.from);
          console.log(responseData.body); 
      }
  });
  res.send(200);
});

app.get('/healthz', function(req, res) {
  res.send('OK'); //**REQUIRED, SO NANO LAMBDA CAN DO HEALTH CHECKS
});  

server.listen(port,function(){
    console.log('Server is running on port: '+ port);
});
                  
                

//save this as package.json
{
  "name": "TwilioSMS",
  "description": "",
  "dependencies": {
    "twilio": "*",
    "body-parser": "^1.13.1",
    "express": "~4.1.1",
    "method-override": "~2.3.1"
  },
  "main": "server.js"
}


Send An email via node.js

Invoke Command:

~$ curl -X POST 'https://{{your_lambda_url}}/v1/services/{{lambda_name}}/{{endpoint}}' \
                        -d 'body=foo'  \
                        -u {{your_AuthToken}}:[AuthToken]

will be posted soon.

Want to help? Write your own and contact us. Some interesting examples may include, chat-bots, pre-processing images for storage, data transformations, triggers for HIVE scripts, or any other micro-service our community can benefit from. Credit will be given. mail us