Returns files with the tag on nodejs. How?


Is nodejs code:

var http = require('http');
var fs = require('fs');

new http.Server(function(req, res){

 sendFile("index.html", res);


function sendFile(file_src, res){

 var file = new fs.ReadStream('index.html');

 file.on('error', function(err){
 Res. statusCode = 500;
 Res. end("Server Error");

 Res. on('close', function(){


Which gives this file:

<!DOCTYPE html>
<html lang="en">
the <head>
 <meta charset="UTF-8">
the <title>Text</title>
the <body>
the <h1>Text</h1>
<img src="logo.png"> 

But when entering the page via the browser no pictures!

How to make so that it was?

In advance I Express my deep gratitude to all who help!
March 19th 20 at 09:28
0 answer

Find more questions by tags Node.js