Skip to content

createNextApiHandler

createNextApiHandler(client): NextApiHandler<any>

Creates a Next.js API handler for a Tevm JSON-RPC server

Parameters

client: Client

Returns

NextApiHandler<any>

Example

import { createNextApiHandler } from 'tevm/server'
import { createMemoryClient } from 'tevm'
const tevm = createMemoryClient()
export default createNextApiHandler({ request: tevm.request })

Defined in

packages/server/src/adapters/createNextApiHandler.js:16