Beignet API reference
    Preparing search index...

    Function defineRoutes

    Server helpers re-exported for Next.js apps.

    • Define and flatten route registrations with strong type inference.

      Pass route definitions and route groups here before createServer(...). Group entries are flattened so downstream tooling receives one route list.

      Type Parameters

      • Ctx
      • const R extends readonly RouteInput<Ctx>[] = readonly RouteInput<Ctx>[]

      Parameters

      • routes: R

      Returns FlattenRouteInputs<R>

      const routes = defineRoutes<AppContext>([
      { contract: listPosts, handle: async ({ ctx }) => ctx.posts.list() },
      ]);