Skip to content

NextJS route.ts helper to make it easy to passthrough API calls #844

@jmoseley

Description

@jmoseley

Maybe something like:

// app/api/gensx/[...path]/route.ts
import { createPassthroughHandlers } from '@gensx/nextjs';

// This will export GET/POST/etc handlers that look at the path and try to infer the operation.
export {
  ...createPassthroughHandlers({
    apiKey: process.env.GENSX_API_KEY,
    org: process.env.GENSX_ORG,
    project: process.env.GENSX_PROJECT,
    env: process.env.GENSX_ENV
  });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions