Routing
Patties uses filesystem routing compiled into Bun route patterns.
Expected app structure
app/routes/holds page routes and API handlersapp/islands/holds interactive client components
Example route shapes already used in the test fixtures include:
app/routes/index.tsx->/app/routes/about.tsx->/aboutapp/routes/hotels/[city].tsx->/hotels/:cityapp/routes/api/ping.ts->/api/ping
Runtime flow
Typical server bootstrap code looks like this:
import { createRenderer, createRouter, startServer } from "patties";
const renderer = createRenderer({ dev: true });
const { routes, fallback } = await createRouter({
appDir: import.meta.dir + "/app",
renderer,
});
startServer({ routes, fallback, dev: true });
createRouter builds the route table from the filesystem and startServer serves the resulting handlers.