Open ehijzengsf opened 3 years ago
Hi, For some reason the get requests are working but de post requests do not work. It causes a 404. Am I missing something?
This sample code is not utilizing post or get requests, do you mean socket.io emit events?
Thanks for responding so quickly! In the following screenshot you the get en posts. This is coming form inspector > network > xhr in firefox.
Ah, I see. From my experience, this issue has most likely to do with the port. Try setting a different port in the .env file (ex. to 8080
or hard-coding your local machine's IP adress instead of localhost
.
A second guess would be to add an explicit IP address in the server.js express http.listen()
function, ex. http.listen(3000, '127.0.0.1')
Thanks I tried: http://127.0.0.1:8080. Same issue http://192.168.19.61:8080. Same issue hard coded: http.listen(8080, '192.168.19.61', () => { console.log ("server started"); })
.env.development: VUE_APP_HOST=192.168.19.61:8080 PORT=8080 HOST=192.168.19.61
This post, is it originated by vue-socket.io-extended@4.0.3? Is that normal behavior or is it simply not supported by socket.io?
I see. I took a quick stab at it myself. Updating the dependencies apparently introduced some breaking changes because vue-socket.io-extended
was wacky and opened multiple socket connections at once. I'm not sure when I have the time to dig into this, but I've updated the dependencies and switched to vue-socket.io
instead of its extended fork.
Give it a whirl and see if it fixes your issue, I'm not sure when I have time to dig deeper into this.
Hi, To make it start I had to add PORT=3000 in de .env.development file.