I want to let [POST] localhost/product just this API to cross domain.
I dont know how to do it
fastify.register(require('fastify-cors'), { origin:'*', methods:['POST'], })
this is my api:
{ method: 'POST', url: '/product', handler: productsController.addProduct, },
https://stackoverflow.com/questions/65557198/how-to-use-fatify-cors-to-enable-just-one-api-to-cross-domain January 04, 2021 at 11:06AM
没有评论:
发表评论