How to enable CORS in Grails 3.0.1

后端 未结 7 1342
有刺的猬
有刺的猬 2021-02-18 22:45

I would like to do cross origin communication using Grails in server side. The only documentation that I found is this one

https://grails.org/plugin/cors

but thi

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-18 22:55

    So, if you got here using grails 3.2.+ you can use the default way.

    Go to your application.yml and add:

    grails:
        cors:
            enabled: true
    

    It will add Access-Control-Allow-Origin '*'. If you want something different, look this page

提交回复
热议问题