Simple JSON Routes: Rate limiting?

Hi guys,

is there an elegent and simple way to rate-limit API calls (defined via https://atmospherejs.com/simple/json-routes)?

I got something like

JsonRoutes.add("get", "/posts/:id", function (req, res, next) {
  var id = req.params.id;
  JsonRoutes.sendResult(res, {
    data: Posts.findOne(id)
  });
});

Any suggestions?

JsonRoutes uses connect so it should be relatively simple to write a middleware to accomplish this.