NEO
NEO2y ago

CORS in standalone server

Hi, I'm trying to get CORS working in standalone server. Attempted this solution but unfortunately it no longer works with v10 https://github.com/trpc/trpc/issues/623 And with my own code for v10 it throws a "405 METHOD_NOT_SUPPORTED" when the method is set to OPTIONS
GitHub
@trpc/server - Handling CORS and CORS preflight requests · Issue #6...
When using the standalone server, it might be useful to handle CORS preflight requests. Currently the request just falls with a 405, Method Not Allowed. I'm proposing the addition of a cors...
3 Replies
julius
julius2y ago
GitHub
trpc/index.ts at next · trpc/trpc
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/index.ts at next · trpc/trpc
NEO
NEO2y ago
Thanks, tho it would be helpful to have some reference in the actual docs page https://trpc.io/docs/v10/cors has nothing about server side implementation
julius
julius2y ago
Yea I can look into adding something