Since iojs merged into Node. I assumed I can run koajs without the --harmony
tag (because it'll have generators from es6 supported).
So within my server.js
file I have:
var koa = require('koa');
var app = koa();
app.use(function *(){
this.body = 'Hello World';
});
app.listen(3000);
My package.json
file has "koa": "^1.1.2"
.
I run node server.js
and get:
app.use(function *(){
^
SyntaxError: Unexpected token *
Any ideas why it's complaining? Do I still need to use the --harmony
tag?
Thanks!