🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

clay-runtime

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

clay-runtime

Clay runtime toolkit

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Clay Runtime

Provides a simple to use interface for lambda functions.

Currently supports:

  • Amazon Web Services Lambda

Install

$ npm install https://github.com/clay-run/clay-runtime.git --save

Then use the starter code:

// Require your files or libraries here. You can use npm to install libraries.
var clay = require('clay-runtime');

exports.handler = function() {
    // Has to be the first line of the function
    clay.start()

    /*
    Your service only responds to POST requests
    any variables passed are found in clay.params
    clay.params is a convenience that parses any JSON
    objects that were passed in the POST request
    */

    var key1 = clay.params.key1;

    /*
    JSON Stringify the result of the service call
    In this example we simply pass back whatever parameters
    were sent to the service
    */

    clay.status(200) // Set the status of the endpoint
        .header('Header', 'value') // Set custom headers
        .end(clay.params); // Send JSON or any data back
}

Documentation

Soon to come! Go to Clay.run to learn more about Lambda functions.

FAQs

Package last updated on 12 Jun 2017

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