Readme
Example Hono-Zod-OpenAPI app with a Fiberplane API explorer.
For an example with regular-old Hono, see: https://www.val.town/v/fiberplane/fiberplaneHonoStarter
app.doc("/doc", {
openapi: "3.0.0",
info: {
title: "User Management API",
version: "v1.0.0",
},
});
import { createFiberplane } from "https://esm.sh/@fiberplane/hono@0.4.3-valtown.1";
import { OpenAPIHono } from "https://esm.sh/@hono/zod-openapi@0.18.4";
const app = new OpenAPIHono();
// ... Define your api routes here!
app.use(
"/*",
createFiberplane({
openapi: { url: "/doc" },
}),
);
export default app.fetch;
- Visit your Val's root route to play with the API explorer!
createFiberplane
mounts a UI at the root route (/
), which can be used to explore the api's routes and make requests.
Think of it like an embedded, lightweight postman.
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
fiberplane-fiberplanehonoopenapistarter.web.val.run
Updated: February 24, 2025