oscarama
trpc cors
my sveltekit app is running on https://example.com with tRPC and it's making requests to http://127.0.01:3001/api/trpc (otherwise it won't work) but I'm getting a CORS error (' The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:3001/api/trpc/model.getAll?batch=1&input=%7B%7D. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)'). how can I fix this?
29 replies
cookies, headers and authentication
in express I can do something like
res.cookie("name", "value")
for example.
alternatively I can do res.set"set-cookie", "name=value")
.
how can I do something one of the two above with trpc?
or is there another, standardized way to do auth?
I'm using trpc v10 and sveltekit13 replies