Expected app structure

  • app/routes/ holds page routes and API handlers
  • app/islands/ holds interactive client components

Example route shapes already used in the test fixtures include:

  • app/routes/index.tsx -> /
  • app/routes/about.tsx -> /about
  • app/routes/hotels/[city].tsx -> /hotels/:city
  • app/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.

Patties documentation · Licensed under MIT. · Design specs