-
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
f979424
commit c8a172c
Showing
4 changed files
with
15 additions
and
37 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import puppeteer from "https://deno.land/x/puppeteer@9.0.2/mod.ts"; | ||
import * as oak from "https://deno.land/x/oak@v9.0.1/mod.ts"; | ||
import puppeteer from "npm:puppeteer[email protected]"; | ||
import * as oak from "https://deno.land/x/oak@v17.0.0/mod.ts"; | ||
|
||
export { | ||
puppeteer, | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,6 @@ import Hosts from 'https://deno.land/x/[email protected]/mod.ts'; | |
|
||
|
||
async function html2pdf(html: string, browserURL?: string) { | ||
let host = ''; | ||
if (!browserURL) { | ||
let host = ''; | ||
/* | ||
|
@@ -19,15 +18,7 @@ async function html2pdf(html: string, browserURL?: string) { | |
provided in fetch(), and there aren't other reliable http client | ||
implementations. | ||
*/ | ||
if (Deno.env.get('ECS')) { | ||
console.log(">>>>>>>>>>>>>>>>>>> ECS"); | ||
const hostsPath = "/etc/hosts"; // Hosts file path | ||
const hosts = new Hosts(Deno.readTextFileSync(hostsPath)); | ||
host = hosts.resolve(Deno.env.get('CHROME_HOSTNAME') as string) as string; | ||
} else { | ||
host = (await Deno.resolveDns(Deno.env.get('CHROME_HOSTNAME') as string, 'A'))[0]; | ||
} | ||
console.log(host); | ||
host = (await Deno.resolveDns(Deno.env.get('CHROME_HOSTNAME') as string, 'A'))[0]; | ||
const port = Deno.env.get('CHROME_PORT'); | ||
browserURL = `http://${host}:${port}`; | ||
} | ||
|