GETTING STARTED
NODE.JS

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

A typical use of Node.js with mydigitalstructure.cloud is as a transformation or automation agent (proxy).

The first step is to install Node.js on your local client for developing/testing.

You can use an environment like AWS Lambda to host your Node.js app when want to deploy it to production.

We have created an open source Node.js npm module to assist with building apps that work with the mydigitalstructure.cloud service/api.

The code in the examples is assuming that the app will be hosted using AWS Lambda and thus wrapped in a module.exports.  You can use aws-lambda-local to run it locally or if you don't plan to use AWS Lambda, unwrap the code from the module.exports.

RESOURCES

Starting an app (boilerplate code) Code for starting a project is available @

github.com/ibcom/mydigitalstructure-sdk-nodejs

npm module Module for using mydigitalstructure.cloud service/api for authentication & data storage and access control.

npmjs.org/package/mydigitalstructure

eg for MacOS:

sudo npm install mydigitalstructure

Example app Automated messaging service using sdk is available @

github.com/ibcom/mydigitalstructure-messaging

 

nodejs.org
AWS Lambda
npm
Setting up a http proxy with Node.js
RunKit
W3Schools Tutorials

 

  AWS LAMBDA      
 

You can use AWS Lambda to host your application - ie can work on a pre-defined schedule (ie time based) or other data-driven events.

Lambda event run time is 15 minutes.

To create an API (as a source of event input/trigger) for your lambda function you could use AWS API Gateway or AWS AppSync.

Lambda uses the same npm package.json format.

Programming Model

Creating a Deployment Package

Running local using aws-lambda-local

Scheduling events

aws-lambda

     
  PROTECTING CODE USING NODE.JS       
 

Another scenario for using Node.js is to protect your code ie if you have intellectual property you want to protect or security settings etc.  

mydigitalstructure Education - JS Engine Options