How to use nginx as a proxy to implement cross-domain requests?

A node service is set up locally, with the following code

let http = require("http")
let data = {
  name: "Andy",
  age: 27
}
http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "application/json;charset=utf-8"})
  response.end(JSON.stringify(data))
}).listen(8888)

console.log("")

nginx is configured as follows:

server {
  listen       80;
  server_name  localhost;
  location / {
      proxy_pass http://localhost:8888;
   }
}

I tried to use axios in my vue project to request data from the node service, but it was unsuccessful.

axios.get("localhost:8888").then(res => {

})

error message:

Failed to load localhost:8888: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

I don"t quite understand when I write for the first time. Please tell me what"s wrong with it.

Jul.23,2021
The

prompt is obvious. Add the protocol http to the request

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea90c1-1f27.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea90c1-1f27.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?