Created
September 6, 2013 13:33
-
-
Save idx3d/6463854 to your computer and use it in GitHub Desktop.
My tries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var co = require('co'); | |
var express = require('express'); | |
var wrapper = require('co-express'); | |
var app = wrapper(express()); | |
var wait = require('co-wait'); | |
app.get('/test', function* (req, res, next) { | |
yield waitAndAnswer(res) | |
}); | |
function* waitAndAnswer (res) { | |
yield wait(10000); | |
res.send('Done: ' + Date.now()); | |
} | |
app.listen(8000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment