I try koajs today and write the helloworld example:
/**
* index.js
*/
var koa = require('koa');
var app = koa();
app.use(function*(){
this.body = 'hello world';
console.log('success!');
});
app.listen(8080);
then I run the index.js file and visit the localhost:8080 in browser, but the console.log seems triggered twice everytime I refresh the page. why ?