Ich habe einen restify Server meine API ausgeführt wird, und ich bin der Definition cors Middleware wie folgt:Restify und vue cors Cross-Domain blockiert
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser());
server.use(restify.bodyParser({
multiples: true,
mapParams: false
}));
server.pre(restify.CORS())
server.use(restify.fullResponse())
server.use(
function crossOrigin(req,res,next){
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
return next();
});
aber ich bin immer diese Fehlermeldung bekommen:
Cross- Gesperrte Ursprungsanforderung: Die Richtlinie "Gleiche Herkunft" verbietet das Lesen der Remoteressource unter https://myroute ... (Grund: CORS-Preflight-Kanal ist nicht erfolgreich).
Was mache ich falsch?