1.1.1 • Published 2 years ago

@netlify/functions-runtime-api v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Build Node

Netlify Functions runtime API

The runtime API for Netlify Functions, compatible with the AWS Lambda runtime API.

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}`)

Functions also receive a context object with a series of convenience properties and methods for easy access to common operations and Netlify features.

export default async (req, context) => {
  if (req.url === '/move-me') {
    return context.redirect('/other-page')
  }

  return context.json({ hello: 'world' })
}

Development

These are two main artifacts produced by this project:

  1. npm module: The API and the Lambda interoperability layer are published as an npm module. To generate the module, run npm run compile.
  2. Lambda Layer: The runtime API is injected into user code using Lambda Layers. To generate the layer ZIP archive, run npm run build.
1.1.1

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago