Solution for Deploying Effect HttpApi on AWS Lambda
Was really struggling to get an Effect HttpApi deployed on aws lambda but finally found a solution so I thought I would share!
import { handle } from "hono/aws-lambda";
const app = HttpApiBuilder.toWebHandler(
Layer.mergeAll(
ApiLive.pipe(Layer.provide(MainLayer), Layer.provide(BuildMetadata.Live)),
NodeHttpServer.layerContext
)
);
const webHandler = app.handler;
// @ts-ignore
export const handler = handle({ fetch: (req) => webHandler(req) });