Created
December 13, 2021 16:23
-
-
Save wangziling/7bd50757e1faec6fc5cc102974318f0b to your computer and use it in GitHub Desktop.
date.deno.dev
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 */ | |
/// <reference no-default-lib="true"/> | |
/// <reference lib="dom" /> | |
/// <reference lib="dom.asynciterable" /> | |
/// <reference lib="deno.ns" /> | |
import { serve } from "https://deno.land/std@0.114.0/http/server.ts"; | |
import { h, ssr, tw } from "https://crux.land/nanossr@0.0.1"; | |
const ShowDate = (props) => ( | |
<div class={tw`bg-white flex h-screen`}> | |
<h1 class={tw`text-5xl text-gray-600 m-auto mt-20`}>{ new Date().toLocaleString() }</h1> | |
</div> | |
); | |
console.log("Listening on http://localhost:8080"); | |
serve((req) => ssr(() => <ShowDate />)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment