I have the following code server side code:
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendfile('index.html');
});
app.get('/data/cursor.png', function(res, res) {
res.type('png');
res.sendfile('data/cursor.png');
});
and on the client side i have the following code:
<img class="cursor" src="data/cursor.png">
and when i load the index.html i get the following error: GET http://localhost:3000/cursor.png 404 (Not Found) why is this happening? i also send some other files like the javascript file and css. and they work just fine... so res.sendfile('js/drawingV2.js'); works totally fine.
app.get('/js/drawingV2.js', function(res, res) {
res.sendfile('js/drawingV2.js');
});
could someone explain to me what i am doing wrong? if you need more code or if i am unclear pls let me know :)