I am using cors_plug library but still getting error CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource

I am already using CORSPLUG And not doing any extra config change in config.exs or router or anywhere else, i.e, I am leaving the plugin in its default config , that is allow all “*” , it seems to work, but now also I got the error of No ‘Access-Control-Allow-Origin’ header is present I dont understand, why its failing the cors, as the plugin is already enabled and was working previously?
in my endpoint.ex I have the code as->

  plug(CORSPlug)

Any help is much appreciated!

  1. check your router.ex
  2. make sure you are requesting to “/api”
  3. make sure u put cors plug inside pipeline :api
pipeline :api do
  ...
 plug(CORSPlug)
end