Saturday, December 17, 2016

Node.js Tutorial for Beginners 13 - pipes

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

http.createServer(function (req, res) {
   // Send the HTTP header 
   // HTTP Status: 200 : OK
   // Content Type: text/plain

   res.writeHead(200, {'Content-Type': 'text/plain'});   
   var readStream = fs.createReadStream('file.txt', 'utf8');

// Console will print the message
console.log("server is running on")
IT Certification Category (English)640x480

Partner Sites

Top Online Courses From ProgrammingKnowledge

Python Course
Java Course
Bash Course
Linux Course
C Course
C++ Course
PHP Course
Android Course
C# Course
JavaFx Course
NodeJs Course
Jenkins Course
Scala Course
Bootstrap Course
MongoDB Course
QT C++ GUI Course