Корр
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=~/chromeTemp
Impossible Ibis
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=~/chromeTemp
sharing resources between different sources
var express = require('express')
var cors = require('cors')
var app = express()
app.use(cors())
app.get('/products/:id', function (req, res, next) {
res.json({msg: 'This is CORS-enabled for all origins!'})
})
app.listen(80, function () {
console.log('CORS-enabled web server listening on port 80')
})
var socket = io('http://yourDomain:port', { transports: ['websocket', 'polling', 'flashsocket'] });
$ npm install cors
For node.js install cors() to your application
const config = {
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
},
}
const {data} = await axios.post(`/api`, data, config)
совместное использование ресурсов между разными источниками