This is a simple API built using Node.js and Express.js that allows you to perform Google Reverse Image Search by providing an image URL. The API uses Cheerio to scrap Google's image search engine's html to get result text and similar images url.
On a preflight call from the browser the OPTIONS call returns no CORS Allow headers, and as other applications runs in a different origin, the browser doesn't allow the api call to succeed.
Can we handle this and add Access-Control-Allow-Origin, Access-Control-Allow-Methods and Access-Control-Allow-Headers headers to the OPTIONS call response.
I am not very good at Express and Node, but I guess it must be some sort of configurable option in the server config.
On a preflight call from the browser the OPTIONS call returns no CORS Allow headers, and as other applications runs in a different origin, the browser doesn't allow the api call to succeed.
Can we handle this and add
Access-Control-Allow-Origin
,Access-Control-Allow-Methods
andAccess-Control-Allow-Headers
headers to the OPTIONS call response.I am not very good at Express and Node, but I guess it must be some sort of configurable option in the server config.
Thanks!