You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@netlify/serverless-functions-api

Package Overview
Dependencies
Maintainers
21
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/serverless-functions-api

The runtime API for Netlify Functions

1.0.0
Source
npmnpm
Version published
Weekly downloads
1.5M
1.64%
Maintainers
21
Weekly downloads
 
Created
Source

Build Node

Netlify Functions 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' })
}

FAQs

Package last updated on 20 Apr 2023

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