I try to share my code betwen server and client I use following code (app.js):
var io = require('socket.io').listen(8000),
Static = require('socket.io').Static;
io.configure(function () {
var _static = new Static(io);
// some methods to add my custom files
_static.add('\public\test.js');
io.set('static', _static);
});
My file structure looks like this:
- root
- app.js
- public
- test.js
When I type "http://localhost:8000/public.test.js" Browser download default file "Welcome to socket.io"