From 7a2d1cb5373b11d785a79075cc0cfdb88ba206a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BCmay=20=C3=87eber?= Date: Thu, 6 Apr 2017 18:13:42 +0300 Subject: [PATCH] ignore file, koa@2, node@7.8 --- .gitignore | 2 ++ koaserver.js | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .gitignore 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);