Skip to main content
Module

x/nat/mod.ts

A server side rendering framework for Deno CLI and Deploy. 🦟 🦕
Latest
import * as nat from "https://deno.land/x/nat@0.0.2/mod.ts";

A server side rendering framework for Deno CLI and Deploy.

Incorporating acorn, nano-jsx, and twind, it provides the tooling to provide a server centric framework for providing dynamic websites served from the edge.

Example

import { Fragment, h, init, render, tw } from "../mod.ts";

const router = init();
const style = createStyle({
  title: "text-xl",
});

const App = ({ name }: { name: string }) => (
  <>
    <div class={style("title")}>Hello {name}!</div>
  </>
);

router.get("/", render(<App name="world" />));

router.listen();

Functions

A factory function that will return a StyleFunction that will make it easy to re-use groupings of twind/tailwind classes.

Initialize the environment optionally using the provided options, returning an instance of Router.

A handler function which renders JSX and send it to the client.