Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

iopa-serverless

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iopa-serverless

API-First Serverless Cloud Function manager for Internet of Things (IoT), based on Internet of Protocols Alliance (IOPA) specification

latest
Source
npmnpm
Version
1.4.0
Version published
Maintainers
1
Created
Source

IOPA
iopa-serverless

NPM

About

This repository contains a simple abstaction layer to translate various serverless host environments and localhost to a common open-standards defined request and response context.

The opportunity

Serverless hosts including AWS Lambda, Microsoft Azure Functions and Google Cloud Functions let you run code without provisioning or managing servers. You generally pay only for the compute time you consume - there is usually no charge when your code is not running. You can run code for virtually any type of application or backend service - all with zero administration.

The problem

It is currently not possible to reuse the same codeset across multiple cloud hosts, and yet the functionality provided by the host environment is very similar -- typically providing a request record for the inbound event trigger and a context record for the response. It is also not possible to develop and test locally without additional frameworks that vary based on the target host.

The solution

This libraryprovides a very lightweight abstraction layer to translate the request and response into a format that can be reused regardless of the host environment, and can be used locally just as easily as remotely.

It is now possible to write a single serverless function and host on multiple providers (to optimize pricing, load balance during catastrophic service provider failures etc.)

Middleware/Application Pipeline Builder: AppBuilder

app.use(middleware)

Adds a middleware node to the IOPA function pipeline. The middleware are invoked in the order they are added: the first middleware passed to app.use will be the outermost function, and the last middleware passed to Use will be the innermost.

example index.js for Azure


const iopaServerless=require('./iopa-serverless'),
      demo = require('./demo');

module.exports = iopaCloud.azure(
     demo
);

example function.json for Azure

{
    "bindings": [
        {
            "webHookType": "",
            "type": "httpTrigger",
            "direction": "in",
            "name": "req"
        },
        {
            "type": "http",
            "direction": "out",
            "name": "res"
        }
    ],
    "disabled": false
}

API Reference Specification

IOPA

Keywords

iopa

FAQs

Package last updated on 21 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts