Skip to content

Instantly share code, notes, and snippets.

@wangziling
Created December 13, 2021 16:23
Show Gist options
  • Save wangziling/7bd50757e1faec6fc5cc102974318f0b to your computer and use it in GitHub Desktop.
Save wangziling/7bd50757e1faec6fc5cc102974318f0b to your computer and use it in GitHub Desktop.
date.deno.dev
/** @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