Skip to content

Commit

Permalink
add the htx library
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Apr 6, 2024
1 parent f8f9ba6 commit 57cea35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cli/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Delete } from "@fartlabs/rtx";
import { Get, Post, Router } from "@fartlabs/rtx";
import { Delete, Get, Post, Router } from "@fartlabs/rtx";
import { A, BODY, H1, P } from "@fartlabs/htx";
import { go } from "go/go.ts";

type Shortlinks = Record<string, string>;
Expand Down Expand Up @@ -91,6 +91,20 @@ if (import.meta.main) {
return Response.json({ message: "Shortlink deleted." });
}}
/>
<Get
pattern="/"
handle={() => {
return new Response(
<BODY>
<H1>
<A href="/">go.fart.tools</A>
</H1>
<P>Welcome!</P>
</BODY>,
{ headers: { "Content-Type": "text/html" } },
);
}}
/>
<Get
pattern="/:path*"
handle={async (ctx) => {
Expand Down
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"lock": false,
"imports": {
"@fartlabs/htx": "jsr:@fartlabs/htx@^0.0.1",
"@fartlabs/jsonx": "jsr:@fartlabs/jsonx@^0.0.10",
"@fartlabs/rtx": "jsr:@fartlabs/rtx@^0.0.2",
"@std/assert": "jsr:@std/assert@^0.221.0",
Expand Down

0 comments on commit 57cea35

Please sign in to comment.