Skip to content

Latest commit

 

History

History

adapter-netlify-functions

@hattip/adapter-netlify-functions

Hattip adapter for Netlify Functions.

Usage

Assuming you have your Hattip handler defined in handler.js, create an entry file like the following and use @hattip/bundler-netlify or your favorite bundler to bundle it:

import netlifyFunctionsAdapter from "@hattip/adapter-netlify-functions";
import hattipHandler from "./handler.js";

export const handler = netlifyFunctionsAdapter(hattipHandler);

fetch implementation

This adapter uses node-fetch as its fetch implementation.

context.passThrough behavior

Calling context.passThrough has no effect, the placeholder response will be returned.

context.platform

export interface NetlifyFunctionsPlatformInfo {
  name: "netlify-functions";
  event: NetlifyFunctionEvent;
  context: NetlifyFunctionContext;
}