sms-46elks

0.5.0 • Public • Published

46Elks incoming SMS endpoint createor

This is a simple module that will create an http server with a single endpoint for handling incomoing POST requests from 46Elks.

Usage

It is extremly basic and you set it up like this:

// Load module
var elks = require('sms-46elks');

// Create a new endpoint with the path and the port
var smsServer = elks.create('/46elks/sms', 8787);

// Listen for the incoming event
smsServer.on('incoming', function(sms) {

    // Print who it came from
    console.log(sms.from);

    // Print who it was for
    console.log(sms.to);

    // Print the message
    console.log(sms.message);

}

smsServer.init(function() {
    console.log("SMS endpoint started");
});

Dependents (0)

Package Sidebar

Install

npm i sms-46elks

Weekly Downloads

1

Version

0.5.0

License

MIT

Last publish

Collaborators

  • camilo.tapia