-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): configurable puppeteer headless mode
- Loading branch information
1 parent
e5fa65e
commit 3ad644e
Showing
6 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { z } from 'zod'; | ||
|
||
export const pdfConfig = z.object({ | ||
puppeteer: z.object({ | ||
headless: z.union([z.literal('shell'), z.boolean()]).default(true), | ||
}), | ||
}); | ||
export type PdfConfig = z.infer<typeof pdfConfig>; | ||
export type PuppeteerOptions = PdfConfig['puppeteer']; | ||
|
||
export default pdfConfig.parse({ | ||
puppeteer: { | ||
headless: process.env.PUPPETEER_HEADLESS === 'true' ? true : process.env.PUPPETEER_HEADLESS, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
PDF generation is implemented using [puppeteer](https://pptr.dev). | ||
|
||
## Puppeteer | ||
|
||
### Headless | ||
|
||
- object-path: `puppeteer.headless` | ||
- dotenv var: `PUPPETEER_HEADLESS` | ||
- type: `boolean | 'shell'` | ||
- default: `true` |