top | item 10790263

(no title)

Killswitch | 10 years ago

Koa is the successor of Express, written by Express creator, TJ. I like it because generator workflow makes writing apps better since we can yield promises. Code is much cleaner.

  app.get('/', function * () {
    this.body = yield User.all()
  })
vs

  app.get('/', function (req, res) {
    User.all(function (err, users) {
      if (err) throw err
      res.end(users)
    })
  })

discuss

order

joepie91_|10 years ago

You can use promises in Express just fine, though. Especially with `express-promise-router`. Not really fair to compare it to nodeback code in Express :)

rodrigogs|10 years ago

Cool stuff. Going to check it out.