deno on AWS Lambda
mod.ts
exports types, from types.d.ts
, for writing handler functions:
import {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Context
} from "https://deno.land/x/lambda/mod.ts";
export async function handler(
event: APIGatewayProxyEvent,
context: Context
): Promise<APIGatewayProxyResult> {
return {
statusCode: 200,
body: `Welcome to deno ${Deno.version.deno} 🦕`
};
}
See deno-lambda repository to run deno on AWS Lambda.
Note: The bootstrap
script is the entrypoint used by AWS Lambda.