Back

Version 29

12/5/2023
/** @jsxImportSource https://esm.sh/hono@3.9.2/jsx **/

import type { FC } from "https://esm.sh/hono@3.9.2/jsx";
import { db } from "https://esm.town/v/nbbaier/lowdbTest";
import { Hono } from "npm:hono";
import { html } from "npm:hono/html";

const app = new Hono();
const resources = Object.keys(db.data);

const Layout: FC = (props) => {
return (
<html>
<head>
<title>JSON Server</title>
</head>
<body>{props.children}</body>
</html>
);
};

const Body: FC<{ resources: string[] }> = (props: { resources: string[] }) => {
return (
<Layout>
<h1>Hello Hono!</h1>
<ul>
{props.resources.map((resource) => {
return (
<li>
<a href={resource}>{`/${resource}`}</a>
{/* <sup>1x</sup> */}
</li>
);
})}
</ul>
</Layout>
Updated: February 4, 2024