Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

With BabelJS, or the co modules (used with generators) you can get a very similar model...

    app.use(function *(){
      var db = yeild getDbConnection();
      var data = db.query("procname", this.request.query.param);
      this.body = JSON.stringify(data);
    });
This of course assumes you have a db interface that uses Primises and are using koa for your web platform in a version of node that supports Generators, or are using something like BabelJS or traceur.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: