Katman
Integrations

Remix

Use Katman with Remix action/loader routes.

Remix uses file-based routing with action and loader exports. Katman integrates via a catch-all splat route.

Setup

Create a catch-all route:

// app/routes/rpc.$.tsx
import {  } from "katman/remix"
import {  } from "~/server/rpc"

const  = (, {
  : "/rpc",
  : () => ({
    : getDB(),
    : .(.request.headers),
  }),
})

export const  = 
export const  = 

Procedures are accessible at:

POST /rpc/users/list
POST /rpc/users/create
GET  /rpc/health

Context from Remix loaders

The context function receives the standard Remix LoaderFunctionArgs / ActionFunctionArgs object:

katmanRemix(appRouter, {
  : () => ({
    : .context.user,   // from Remix server context
    : .params,
  }),
})

What's next?

  • Server — standalone serve() as an alternative
  • Integrations — other available integrations

On this page