Skip to content

NeobilitySRL/html-to-pdf-lambda

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

Generate PDF document via Puppeteer running on AWS Lambda

This repo contains a serverless application that takes a HTML template and return a PDF in form of a binary

Diagram

Diagram

Requirements

How to Run

  1. Clone this repo git clone https://github.com/zahaar/generate-pdf-lambda

  2. Import cUrl to Insomnia ( Postman is not recommended, as it can't visualize Pdf ).

  3. Run make api-local to have local API GW running.

  4. Send cUrl request via Insomnia.

You can also invoke Lambda bypassing API GW, by supplying an example event in file, and running make invokation-local. The response would be a base64 encoded PDF binary.

How to Deploy

A configured AWS CLI V2 is a must -> AWS Console Account && API Keys

  1. make deploy

  2. Fetch AWS SAM deploy output URL Value, and change the Url in Insomnia from localhost to that value. execution result in Insomnia End-Result

Improvements

  • Add Authorization Layer to API GW.
  • Configure API GW rate limits and throttling.
  • Enable API GW cache.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 55.9%
  • Makefile 44.1%