-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8672f8
commit 05b6325
Showing
4 changed files
with
241 additions
and
31 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,29 @@ | ||
const puppeteer = require("puppeteer"); | ||
const { execSync } = require("child_process"); | ||
const http = require("http"); | ||
const handler = require("serve-handler"); | ||
|
||
const server = http.createServer((req, res) => { | ||
return handler(req, res, { | ||
public: "build", | ||
}); | ||
}); | ||
|
||
(async () => { | ||
server.listen(3000); | ||
|
||
const browser = await puppeteer.launch(); | ||
const page = await browser.newPage(); | ||
|
||
await page.goto("http://localhost:3000", { | ||
waitUntil: "networkidle2", | ||
}); | ||
|
||
await page.pdf({ | ||
path: "build/josh-rutherford-resume.pdf", | ||
format: "a4", | ||
}); | ||
|
||
await browser.close(); | ||
server.close(); | ||
})(); |
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
Oops, something went wrong.