File: hour-streaming/index.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   hour-streaming/index.js   Download  
File: hour-streaming/index.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 541 bytes
 

Contents

Class file image Download
var sys = require('sys'), http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); sys.puts('Starting sending time'); setInterval(function(){ var currentTime = new Date(); res.write( currentTime.getHours() + ':' + currentTime.getMinutes() + ':' + currentTime.getSeconds() + "\n" ); setTimeout(function() { res.end(); }, 10000); },1000); }).listen(8080);