Replies: 1 comment 2 replies
-
|
@Nathami-n export const loader = async ({ request }) => {
// Handle preflight
if (request.method === "OPTIONS") {
return new Response(null, {
status: 204,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST, OPTIONS",
"Access-Control-Allow-Headers": "Content-Type",
},
});
}
....
}
` |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone ,
I'm working on a project using React Router v7 in framework mode (formerly part of Remix), and I’m encountering a CORS error when making a
POSTrequest to an action endpoint in production.Initially I did not have a custom node server but after trying to set the response headers to allow all origins to no avail I sought to try a custom express server which does not equally work
Setup Overview
Express Server Configuration
Here's a simplified version of my
server.ts:In my webhook endpoint
Beta Was this translation helpful? Give feedback.
All reactions