0.0.3 • Published 10 years ago

genhand v0.0.3

Weekly downloads
12
License
-
Repository
-
Last release
10 years ago

GenHand

Usage

var genhand = require('genhand')
var http    = require('http')

var server = http.createServer(genhand(function*(req, res) {
	// Send the headers (and status code)
	yield genhand.head(200, { 'Content-Type': 'text/html' })
	yield '<h1>Hello World!</h1>'
}).on('error', function(err) {
	console.error(err.stack)
}))
server.listen(3000, function() {
	var addr = server.address()
	if(addr)
		console.log('Server listening on %s:%d', addr.address, addr.port)
	else
		console.log('Server starting: ok!')
})
0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago