cf2-builder
🌐 A toolkit to build AWS CloudFront Functions with strict type definitions
Install
npm i cf2-builder
Example
Source
// src/index.ts
import type { ViewerRequestHandler } from 'cf2-builder'
export default ((event) => {
// ... Application Code
}) satisfies ViewerRequestHandler
Handler Types
Build
import { build } from 'cf2-builder'
await build('src/index.js', 'dist/index.js')
or use CLI
npx cf2-builder src/index.js dist/index.js
Deploy the output js file to CloudFront using your preferred method.
License
MIT