diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d547a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +results.txt diff --git a/koaserver.js b/koaserver.js index 5d42e0f..426ef93 100644 --- a/koaserver.js +++ b/koaserver.js @@ -1,9 +1,9 @@ -var koa = require('koa'); -var app = koa(); +const Koa = require('koa'); +const app = new Koa(); -app.use(function *(){ - this.set('Connection', 'close'); - this.body = 'Hello World!'; +app.use(ctx => { + ctx.set('Connection', 'close'); + ctx.body = 'Hello World'; }); -app.listen(8000); \ No newline at end of file +app.listen(8000);