Request get method

Asked

Viewed 37 times

-1

I would like to make a request get on this api https://api-v2.blaze.com/roulette_games/recent(External api, I don’t have access to it to enable Cors), however, when I do it returns me an error talking about Cors, until then ok, but then I make a request by Insomnia or Postman, and they return me the correct data. Then I was in doubt, they do not make like a fetch? How they bring me the correct data?

1 answer

-2

The error of Cors occurs when a request is made by an unauthorized source (domain), thus occurring only in browsers

To correct this error it is necessary to configure the Cors server-side

If you’re using express to create the API, try installing the Cors package and configuring the instance express in this way

var express = require('express')
var cors = require('cors')
var app = express()

app.use(cors())

Browser other questions tagged

You are not signed in. Login or sign up in order to post.