Hola.
Estoy empezando a probar nodejs y me acabo de topar con un fallo que no soy capaz de solucionar.
Tengo el siguiente código:
Código:
var server = http.createServer(function(req,res){
fs.readFile('./html/index.html', function(error, data){
res.writeHead(200,{'Content-Type':'text/html'});
res.end(data,'utf-8');
});
}).listen(8080,'localhost');
console.log('Servidor funcionando en http://localhost:8080');
y en el fichero HTML:
Código:
<img id="led" src="./html/imagen.png">
Y no hay manera que muestre la imagen.
He probado con distintos paths y nada.
Como se hace para que se muestre la imagen ?
Un Saludo.