Spaces:
Runtime error
Runtime error
T1ckbase
commited on
Commit
Β·
232b9c6
1
Parent(s):
e152268
Dockerfile
CHANGED
@@ -14,5 +14,7 @@ RUN deno -A npm:playwright install --with-deps chromium
|
|
14 |
# Compile the main app
|
15 |
RUN deno cache main.ts
|
16 |
|
|
|
|
|
17 |
# Run the app
|
18 |
CMD ["deno", "run", "-A", "main.ts"]
|
|
|
14 |
# Compile the main app
|
15 |
RUN deno cache main.ts
|
16 |
|
17 |
+
RUN chmod -R 777 /app
|
18 |
+
|
19 |
# Run the app
|
20 |
CMD ["deno", "run", "-A", "main.ts"]
|
deno.json
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
{
|
2 |
"imports": {
|
|
|
3 |
"playwright-core": "npm:playwright-core@^1.53.0"
|
4 |
},
|
5 |
"fmt": {
|
|
|
1 |
{
|
2 |
"imports": {
|
3 |
+
"hono": "jsr:@hono/hono@^4.8.0",
|
4 |
"playwright-core": "npm:playwright-core@^1.53.0"
|
5 |
},
|
6 |
"fmt": {
|
deno.lock
CHANGED
@@ -1,9 +1,15 @@
|
|
1 |
{
|
2 |
"version": "5",
|
3 |
"specifiers": {
|
|
|
4 |
"npm:playwright-core@^1.53.0": "1.53.0",
|
5 |
"npm:playwright@*": "1.51.0"
|
6 |
},
|
|
|
|
|
|
|
|
|
|
|
7 |
"npm": {
|
8 |
"[email protected]": {
|
9 |
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
@@ -31,6 +37,7 @@
|
|
31 |
},
|
32 |
"workspace": {
|
33 |
"dependencies": [
|
|
|
34 |
"npm:playwright-core@^1.53.0"
|
35 |
]
|
36 |
}
|
|
|
1 |
{
|
2 |
"version": "5",
|
3 |
"specifiers": {
|
4 |
+
"jsr:@hono/hono@^4.8.0": "4.8.0",
|
5 |
"npm:playwright-core@^1.53.0": "1.53.0",
|
6 |
"npm:playwright@*": "1.51.0"
|
7 |
},
|
8 |
+
"jsr": {
|
9 |
+
"@hono/[email protected]": {
|
10 |
+
"integrity": "7cfd082110a8658053e57902d187797721df45da9f923cc3ac75755009209f7a"
|
11 |
+
}
|
12 |
+
},
|
13 |
"npm": {
|
14 |
"[email protected]": {
|
15 |
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
|
|
37 |
},
|
38 |
"workspace": {
|
39 |
"dependencies": [
|
40 |
+
"jsr:@hono/hono@^4.8.0",
|
41 |
"npm:playwright-core@^1.53.0"
|
42 |
]
|
43 |
}
|
main.ts
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
import { chromium, devices } from 'playwright-core';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
const browser = await chromium.launch({
|
4 |
headless: false,
|
@@ -18,7 +26,8 @@ const context = await browser.newContext({
|
|
18 |
const page = await context.newPage();
|
19 |
|
20 |
// await page.goto('https://bot.sannysoft.com/');
|
21 |
-
await page.goto('https://translate.google.com/?hl=en&sl=en&tl=es&op=images');
|
|
|
22 |
|
23 |
// await page.pause();
|
24 |
|
|
|
1 |
import { chromium, devices } from 'playwright-core';
|
2 |
+
import { Hono } from 'hono';
|
3 |
+
import { serveStatic } from 'hono/deno';
|
4 |
+
|
5 |
+
const app = new Hono();
|
6 |
+
|
7 |
+
app.use('/screenshot.png', serveStatic({ path: './screenshot.png' }));
|
8 |
+
|
9 |
+
app.get('/', (c) => c.text('Hello World!'));
|
10 |
|
11 |
const browser = await chromium.launch({
|
12 |
headless: false,
|
|
|
26 |
const page = await context.newPage();
|
27 |
|
28 |
// await page.goto('https://bot.sannysoft.com/');
|
29 |
+
await page.goto('https://translate.google.com/?hl=en&sl=en&tl=es&op=images', { waitUntil: 'load' });
|
30 |
+
await page.screenshot({ path: 'screenshot.png', fullPage: true });
|
31 |
|
32 |
// await page.pause();
|
33 |
|