Access control in plumber package in r



When i call service from client side then give that error.
No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘null’ is therefore not allowed access. The response had HTTP status code 404.

I was trying to set request header-

cors <- function(res) {
res$setHeader(“Access-Control-Allow-Origin”, “*”)

But it’s not working

Please tell me how to set request header in plumber.