-
Notifications
You must be signed in to change notification settings - Fork 750
Expand file tree
/
Copy pathmain.tsx
More file actions
36 lines (32 loc) · 852 Bytes
/
main.tsx
File metadata and controls
36 lines (32 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { App } from "../../../src/app.ts";
import { Builder } from "../../../src/dev/mod.ts";
const builder = new Builder();
const app = new App({ staticDir: "./static" }).get(
"/",
(ctx) =>
ctx.render(
<html>
<head>
<meta charset="utf-8" />
<title>foo</title>
</head>
<body>
<div f-client-nav>
<span f-client-nav={false}>
<p>false</p>
</span>
<a href="/">Home</a>
<img src="/foo.jpg" alt="" />
<picture>
<source src="/bar.jpg" />
</picture>
</div>
</body>
</html>,
),
);
await builder.build(app);
const handler = app.handler();
const res = await handler(new Request("http://localhost/"));
// deno-lint-ignore no-console
console.log(await res.text());