Setting endpoint URL does not work
locpd opened this issue · 1 comments
My sveltekit app is configured with a public base URL of /myapp, so all URLs should start with that. I just set up trpc-sveltekit using all the code from https://icflorescu.github.io/trpc-sveltekit/getting-started. The tRPC api endpoint URL defaults to /trpc, which certainly does not work, so I added the url
property in the param for createTRPCHandle
in hooks.server.ts, so now it looks like this:
export const handle: Handle = createTRPCHandle({ router, url: '/myapp/trpc', createContext })
However this seems to have no effect, as I inspect the Network tab of browser dev tools and still see a request to /trpc instead of /myapp/trpc.
My bad, api endpoint URL on client should be configured with createTRPCClient