0👍
You need install Cors in nodejs:npm install cors, you can try the following below or you see: Nodejs + Vuejs
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('This is a CORS-enabled web server listening on port 80')
})
- [Vuejs]-Vue auto restart when use fs.writeFile inside socket.io
- [Vuejs]-Switch VueJS Devtools back on in development
Source:stackexchange.com