Created
June 2, 2023 16:12
-
-
Save kwhinnery/6008f850ac7b74ad438a8fca28f4ddec to your computer and use it in GitHub Desktop.
A single file application in Deno, using JSX and TypeScript
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
/** @jsx h */ | |
import { serve } from "https://deno.land/std@0.190.0/http/mod.ts"; | |
import html, { h } from "https://deno.land/x/htm@0.2.0/mod.ts"; | |
function Greeting({ name }) { | |
return <h1>Hello, {name}!</h1>; | |
} | |
function handler(_req: Request): Response { | |
return html({ | |
body: <Greeting name="Kevin"/> | |
}); | |
} | |
serve(handler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment