it-works-regenerator-server
v0.0.1
Published
HTTP server version of it-works-regenerator-html
Downloads
1
Readme
it-works-regenerator-server
HTTP server version of it-works-regenerator-html
example
test.js
var g = gen(100);
var y = g.next();
while(1) {
if(y.done) break;
console.log(y.value);
y = g.next();
}
index.html
<html>
<head>
<title>it-works-regenerator</title>
</head>
<body>
<h1>
Please view the result in JavaScript console
</h1>
<script src="main.js"></script>
<script src="test.js"></script>
</body>
</html>
server.js
var server = require('it-works-regenerator-server');
var port = process.env.PORT || 8888;
server.listen(port, 'localhost');
console.log('server listen to http://localhost:' + port);