6 ms·
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. Cod
by Killswitch 11y 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)
})
})