Simple JSON Routes: Rate limiting?

Hi guys,

is there an elegent and simple way to rate-limit API calls (defined via

I got something like

JsonRoutes.add("get", "/posts/:id", function (req, res, next) {
  var 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.