-
Hello, I have a bug when i'm trying to do a XMLHttprequest to my adonisjs api: The thing is that if I try with an online tool like reqbin.com it works perfectly. The server is running node v16.5.0 and the latest version of adonisJS 5 I've checked the cors settings in adonisjs, The cors is enabled (set to true) and I'm allowing all origins (origin: '*'). Here is my XMLHttprequest:
If someone have a solution it would be very helpfull thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Can you share your |
Beta Was this translation helpful? Give feedback.
-
The issue was coming from cloudflare proxy who was blocking every requests. I moved the api to let's encrypt and it's working fine ! |
Beta Was this translation helpful? Give feedback.
-
I got a same problem , I tried to use CORS, the preflight request response 404. And then i add Options method in API route , the preflight request response 200, but the origin request can't go on correct. I want to ask , If I want use a complicate cors request (with preflight request) access my API , How should i do in Adonisjs . |
Beta Was this translation helpful? Give feedback.
The issue was coming from cloudflare proxy who was blocking every requests. I moved the api to let's encrypt and it's working fine !