nodeHTTPHandler with Nitro
I'm trying to setup trpc with nitro.unjs.io using the
node-http
adapter.
Frontend setup:
There are no TS errors anywhere so the router setup should be correct.
However the nodeHTTPRequestHandler function always returns undefined
.
I've also tried the trpc-nuxt
package because apparently that's supposed to work with Nitro but I couldn't get it to work because I'm using trpc v11.Solution:Jump to solution
Nvm, it seems to work like this.
Have to return the correct response of course (which revealed another error with the path).
```ts
export default defineEventHandler(async (event) => {
console.log('trpc route handler');...
1 Reply
Solution
Nvm, it seems to work like this.
Have to return the correct response of course (which revealed another error with the path).
No need for
trpc-nuxt
:POGGIES: