Answer the question
In order to leave comments, you need to log in
Why is socket.io-client throwing 404?
Hello!
socket.io-client throws an error:
GET http://localhost:3000/socket.io/?EIO=3&transport=polling&t=MsnbnSd 404 (Not Found)
const fs = require("fs")
let app = require("express")();
const http = require("http").createServer(app)
const socket = require("socket.io")(http)
let port = 3000;
app.get("/", function(req, res) {
res.sendFile(__dirname + "/public/index.html")
})
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "http://localhost:8080");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
res.header("Access-Control-Allow-Headers", "Content-Type");
res.header("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, OPTIONS");
res.header("Access-Control-Allow-Credentials", "true");
next();
});
socket.on('connection', function(socket){
console.log('a user connected');
});
app.listen(port, function() {
console.log(`Сервер успешно запущен, порт - ${port}`)
})
mounted: function() {
let socket = io("localhost:3000", {origins: "domain_1:http://localhost:3000"});
socket.on('news', function(data) {
console.log(data)
})
}
Answer the question
In order to leave comments, you need to log in
I would take svg (flexibly, optimally) or as Ankhena already suggested border-image But I still don’t understand border-image, I think I need a female mindset to use border-image. NO OFFENSE. Female == different != bad
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question