Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

fs render html

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

http.createServer(function(req, res){
    fs.readFile('test.html',function (err, data){
        res.writeHead(200, {'Content-Type': 'text/html','Content-Length':data.length});
        res.write(data);
        res.end();
    });
}).listen(8000);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fs #render #html
ADD COMMENT
Topic
Name
5+8 =