I'm fairly new to Node.js, and trying to build an application for myself. I am using socket.io and it works perfectly fine locally during testing, but when I deploy to Azure I keep getting
http://domain/socket.io/socket.io.js 404 (Not Found)
I have tried most methods and fixes I could find on forums but nothing seems to work, web sockets is enabled on Azure.
My code as below:
Client side:
<script src="/socket.io/socket.io.js"></script>
Server side
var express = require('express');
var port = process.env.port || 1337;
var app = require('express')()
, server = require('http').createServer(app)
, io = require('socket.io').listen(server, { log: false });
server.listen(port);
Any help is much appreciated, thanks in advance.
How did you include the modules?
The easiest way is to create a package.json file (npm init
) and then include that alongside your app.js.
See http://www.windowsazure.com/en-us/documentation/articles/nodejs-use-node-modules-windows-azure-apps/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With