@netlify/serverless-functions-api
TypeScript icon, indicating that this package has built-in type declarations

1.18.3 • Public • Published

npm version Build Node

Serverless Functions API

A Node.js module that implements the runtime API for serverless functions. It translates between the API defined by Netlify and the API expected by the underlying provider, AWS Lambda.

The API

The API surface is quite minimal: functions are comprised of handlers that receive a Request and return a Response, using the default export.

export default async (req) => new Response(`Responding to ${req.url}`)

The module

The module exports a getLambdaHandler function that returns a Lambda-compatible handler. This handler receives a Lambda event, converts it to a Netlify API input (i.e. an instance of the standard Request and a context object), executes the function, and converts the result back into a response compatible with the Lambda API.

The source is bundled into a single file, so that it can be injected into a Lambda without any additional imports or dependencies.

The getPath export returns the absolute path to the module. This lets consumers like zip-it-and-ship-it easily include the file in a ZIP.

/@netlify/serverless-functions-api/

    Package Sidebar

    Install

    npm i @netlify/serverless-functions-api

    Weekly Downloads

    497,909

    Version

    1.18.3

    License

    MIT

    Unpacked Size

    1.07 MB

    Total Files

    34

    Last publish

    Collaborators

    • youvalv
    • berdav
    • vitaliyr
    • smnh
    • denar90
    • kathmbeck
    • rj-netlify
    • akardet
    • pieh
    • hrishikeshk
    • sarahetter
    • orinokai
    • ericap
    • seanroberts
    • skn0tt
    • mikewen
    • biilmann
    • marcus.netlify
    • jgantunes
    • eduardoboucas
    • netlify-bot
    • nasiba
    • ascorbic