admin管理员组文章数量:1356696
I want to combine Hono.js with tRPC. I followed the guide on the 3rd party middleware made by hono for a tRPC server, and now I have set up the hono tRPC server 3rd party middleware similar to the code below:
import { Hono } from 'hono'
import { trpcServer } from '@hono/trpc-server' // Deno 'npm:@hono/trpc-server'
import { appRouter } from './router'
const app = new Hono()
app.use(
'/trpc/*',
trpcServer({
router: appRouter,
})
)
export default app
Now, where should I place this code in Next.js? Should it go in app/api/[[...route]]/route.ts
or in app/api/trpc/[trpc]/route.ts
?
Also, what is the best approach regarding context—should I use the tRPC context or the Hono.js context?
本文标签: Integrating Honojs with tRPC in Nextjs Routing and Context ConsiderationsStack Overflow
版权声明:本文标题:Integrating Hono.js with tRPC in Next.js: Routing and Context Considerations - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743985972a2571278.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论