Access-Control-Allow-Origin Problem

Failed to load resource: Origin http://localhost:8100 is not allowed by Access-Control-Allow-Origin.

When I get request from turbo server, the request always blocked by this issue.

I wrote some response header to pass it. The code is shown below. After deployment, those header are missing.

app.use(function(req, res, next) {
    res.setHeader("Access-Control-Allow-Origin", "*");
    res.setHeader("Access-Control-Allow-Headers", "Accept,Content-Type,X-Requested-With,x-api-key");
    next();
});
luipokit1234567 · September 11th, 2019

Membership Options