Skip to content

Repository files navigation

Base

import{createSolidAPIHandler}from"solid-start-trpc";consthandler=createSolidAPIHandler({router: appRouter,createContext: ()=>null,});exportconstget=handler;exportconstpost=handler;// for version 0.1.6 +exportconstGET=handler;exportconstPOST=handler;

Ctx

constcreateContext=(opts)=>({req: opts.req,res: opts.res});

Response Meta

consthandler=createSolidAPIHandler({router: appRouter,
createContext,responseMeta: ({ ctx })=>{if(ctx?.req.headers.get("x-random-header")){return{headers: {"x-random-header": `hello-${ctx.req.headers.get("x-random-header")}`,},};}return{};},});

About

tRPC API Handler For Solid Start

Resources

Stars

24 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages